В моем конвейере Дженкинса я сделал следующее:
pipeline {
// ..
stages {
stage('Notify') {
script {
def build = currentBuild // global variable in pipeline -> https://opensource.triology.de/jenkins/pipeline-syntax/globals#currentBuild
def targetUrl = "http://some-url?{some-query-params}"
def buildUrl = build.absoluteUrl
def buildNumber = build.number
def buildStatus = build.currentResult
httpRequest url: targetUrl, contentType: 'APPLICATION_JSON', httpMode: 'POST', responseHandle: 'NONE', timeout: 30, requestBody: """
{
"name": "${args.serviceName}",
"build": {
"full_url": "${buildUrl}",
"number": "${buildNumber}",
"phase": "FINISHED",
"status": "${buildStatus}"
}
}
"""
}
}