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, confluence administration, confluence admin training, confluence learning path, manage users and permissions, confluence certification, atlassian learning, cloud admin tools, streamline collaboration, confluence admin best practices

🚨New Confluence Admin Course Alert!

Manage Confluence like never before! This new learning path teaches you how to manage content, users, and permissions while optimizing user experience. Built for admins at all levels who want to confidently lead and unlock more innovative collaboration.

Learn more
AUG Leaders

Atlassian Community Events