Blocking a transition if an inward link is present

Hi,

I know we can enable a transition if a record as at least one outward link is present, using Script Runner's post function.

Is there any work around to BLOCK a transition if the record has at least one inward link is present ?

Can Script Runner help on this ?

Thanks, Vishnu.

2 answers

1 accepted

2 votes

Work out what the code is to allow it, then put an exclamation mark on the front to negate it. Eg:

! issueLinkManager.getOutwardLinks(issue.getId()).any {it.issueLinkType.name == "Escalated From"}

Thanks a lot Jamie.

Hey Vishnu,

See the documentation at https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Simplescriptedcondition

Use a condition like

issueLinkManager.getInwardLinks(issue.getId()).size() > 0

Hi Bhushan

Thanks for the suggestion.

Will this condition allow the transition or block it ? I think it allows.

Also, can I specifically check for a link type not present, say 'Escalted from' ?

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

Basically, I am looking for something like "issueLinkType.name.NOTcontains" operation. Is is available ?

Thanks, Vishnu.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

124 views 4 9
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