Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to execute this post call - tested in different method but failed

Srikanth Ganipisetty
Contributor
September 5, 2023

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
Image_ErroringOut.PNG

0 answers

Suggest an answer

Log in or Sign up to answer