Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Scriptrunner add remotelink

Jason Whitaker May 3, 2020

I'm trying to make use of a script from the scriptrunner documentation that creates a remotelink, however it doesn't seem to work. I am assuming the rest module used is not imported but I am unsure what module to import. The code is as followed:

// The url for the link def linkURL = '<LinkURLHere>' // the title for the link def linkTitle = '<LinkTitleHere>' // The issue key def issueKey = '<IssueKeyHere>' // Create the link on the specified issue def result = post("/rest/api/2/issue/${issueKey}/remotelink") .header('Content-Type', 'application/json') .body([  object: [  title:linkTitle,  url:linkURL ] ]) .asObject(String) // Check if the link created succesfully if (result.status == 201) { return "Remote link with name of ${linkTitle} which links to ${linkURL} created successfully" } else { return "${result.status}: ${result.body}" }


0 answers

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events