Blocking a transition if an inward link is present

Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2014

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
Answer accepted
JamieA
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.
July 12, 2014

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"}

Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 13, 2014

Thanks a lot Jamie.

1 vote
Bhushan Nagaraj
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.
July 10, 2014

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

Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2014

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