Forums

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

Allow transition only when there is no related Issue

GS1337
Contributor
August 27, 2019

Hi, when i click a button on my Issue the Issue creates another Issue Type that is then related to this Issue. I want Users to use this function only once so they cant create multible identical issues with this button. Can somebody help me with the condition so it checks if there is allready an Issue related to this? image.png

1 answer

1 vote
Leo
Community Champion
August 27, 2019

Hi @GS1337 ,

Below snippets may work for you,

If you want to check at least one outward link with particular type, there is already example given by Adaptavist as a help note

issueLinkManager.getOutwardLinks(issue.getId())*.issueLinkType.name.contains('Duplicate')

 

If you want to check irrespective of outward link, below link condition will hide the transition if there is linked issue, will enable/display transition button only if there is no outward link

import com.atlassian.jira.component.ComponentAccessor
def outwardLinks = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())
return outwardLinks.size() == 0

 

Regards,

Leo

Suggest an answer

Log in or Sign up to answer