I was working on a failed script, and got stuck with this.
Please advise me on fixing this POST call - with JSON builder.
Reference: https://docs.groovy-lang.org/latest/html/documentation/core-domain-specific-languages.html#_jsonbuilder
Code:
// Set up the JSON body for the POST request
def jsonBody = new JsonBuilder()
log.warn("jsonBody is : " + jsonBody)
log.warn(jsonBody.content)
jsonBody{
{
globalId 'appId=e9530ad1-eea0-b65d-0d2a2fd1e13b&issueId=${issue.id}'
application {
type 'com.atlassian.jira'
name 'JIRA DEV'
}
relationship 'relates to'
object{
title 'Linked Issues'
summary '${issue.summary}'
}
}
}
log.warn("jsonBody is : " + jsonBody