0
votes

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
There is no message. Most likely here: post.getOutputStream().write(message.getBytes("UTF-8"));cfrick
I feel kinda sheepish, but thanks! That was itJose

1 Answers

0
votes

cfrick has provided the answer to this issue