问题
I'm trying to merge a merge request using the gitlab api and following is what I'm doing using groovy, but I keep hitting errors, I'm pretty new to this so any help is greatly appreciated!
def MRUrl = "https://gitlab.domain.com/api/v4/projects/project_name/merge_requests/113/merge"
def post = new URL(MRUrl).openConnection();
post.setRequestMethod("PUT")
post.setDoOutput(true)
post.setRequestProperty("Private-Token", "${Key}")
post.getOutputStream().write(message.getBytes("UTF-8"));
def responseCode = post.getResponseCode();
Error / exception:
No such property: message for class: gitLab
The gitlab API call is from the following documentation. https://docs.gitlab.com/ee/api/merge_requests.html#accept-mr
回答1:
cfrick has provided the answer to this issue
来源:https://stackoverflow.com/questions/53314866/merging-a-merge-request-using-gitlab-api-commands