how to avoid issue linking of same issue type?

gagan m s February 21, 2019

hello ,

im trying to create a script where it avoids/ deletes if two issues of same issutype is linked.

can i do this using scriptrunner?

1 answer

0 votes
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 21, 2019

Hello @gagan m s 

If the user is trying to link an issue to another issue via the create issue form then you can add a check in the validation phase of the create transition and easily avoid linking of the issue types of same type.

gagan m s February 21, 2019

Hello @Tarun Sapra ,

its not only during creation, we should be able to restrict at any point of time.

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 21, 2019

Then you can try using the behaviour modeul of the SR plugin which works on create and edit screen.

https://community.atlassian.com/t5/Answers-Developer-Questions/Behaviour-plugin-to-restrict-linkedissue-types/qaq-p/536508

def links = getFieldById("issuelinks")
def linkissue = getFieldById("issuelinks-issues")
def linktype = getFieldById("issuelink-types")

And then based on the selection you can check for the issueType and then call setError() on the field

Suggest an answer

Log in or Sign up to answer