Forums

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

Create a linked issue with a certain link type

Mihai Mihai
Contributor
June 18, 2019 edited

Hello, We have a scriptrunner listener that creates an issue linked to the current one, based on a certain field editing action.

We use the following:

def linkManager = ComponentAccessor.getIssueLinkManager()

linkManager.createIssueLink(issue.getId(), newIssue.getId(),(Long)10003,(Long)1,user)

 

where 10003 is the issue link id for the "Blocks" link.

But the link has: inward description: blocks outwards description: is blocked by These do not seem to have any IDs.

I would like for the new issues that are created by the script to have the "blocks" description towards the issue they were created from (and of course, the already existing issues should be "blocked by" the newly created ones).

Thank you!

1 answer

1 accepted

1 vote
Answer accepted
Dar Kronenblum
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2019

Hi Mihai,
you can just switch the newIssue with the issue ids and link will be the other way around (blocks instead of blocked by):

linkManager.createIssueLink(newIssue.getId(), issue.getId(),(Long)10003,(Long)1,user)

Mihai Mihai
Contributor
June 18, 2019

Hello @Dar Kronenblum 

Thank you very much, that works!

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira product discovery, jpd premium, product management, idea management, product discovery, jira premium, product planning, atlassian community, product development, roadmap planning, product prioritization, feature management

Introducing Jira Product Discovery Premium ✨

Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.

Learn more
AUG Leaders

Atlassian Community Events