Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Scriptrunner add remotelink


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

Atlassian Community Events