Creating an issue and linking to parent issue with Scriptrunner Jira Cloud


I just need to define the link to the parent issue when the child gets created and I can't find any example of how to do this.

def taskType = get('/rest/api/2/issuetype').asObject(List).body.find { it['name'] == 'Warranty Claim Robot Component' }['id']
        .header('Content-Type', 'application/json')
                fields: [
                            summary    : 'Test Ignore this',
                            description: "Test Ignore this",
                            project    : [
                                    key: projectNewIssueKey
                            issuetype  : [
                                    id: taskType
							//Need to define issue links here?

I've found a rest example of this but I am unsure of how to convert it to scriptrunner/groovy syntax.

Any help would be much appreciated. 


Kind regards

Thomas P. Hargreaves


1 answer

1 accepted

Hi Thomas,

We've put an example of how to do issue linking in our documentation:

The link has to be created after the issue is created, they can't be done in one request.

I hope that helps,


Hi Jon,

Fantastic, thank you very much.


Kind regards,

Thomas P. Hargreaves

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

88 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you