From inside a Jenkins pipeline, I want to create a merge request on gitlab
def toJson = {
input ->
groovy.json.JsonOutput.toJson(input)
}
def body = [
private_token: "...",
source_branch: "...",
target_branch: "...",
title: "..."
]
httpRequest httpMode: 'POST', requestBody: toJson(body), contentType: 'APPLICATION_JSON', url: 'https://my.gitlab.domain/api/v4/projects/1234/merge_requests'
My problem is with the private_token, I don't want to put it in clear in the Jenkinsfile.
I didn't found a way to get it from Jenkins credentials, is there one ?