Merging a merge request using Gitlab API commands

大城市里の小女人 提交于 2021-01-29 07:25:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!