How can I script a condition based on the status of linked issues?

Morgan Thunder May 27, 2016

I want to put a custom scripted condition/validator (not sure which is better in this case?) on a transition so that it can't be performed unless all linked issues are resolved.

I've tried some scripts I've found on Script Runner forums but get errors with ComponentManager and java.Lang.object and so forth which I'm guessing means they are out of date.

 

Basically I just need a condition that says:

If (there are any issues linked to this one with relationship 'triggered by') AND (the status of those issues is not resolved),  set the value of this condition to FALSE (or whatever doesn't allow the transition).

 

Can anyone please help me to express this in Groovy?

2 answers

0 votes
Wayne Cranford May 27, 2016

I am looking for the same solution, preferably a Validator. I have used the recommended link (scriptrunner.adaptvist.com) and found many useful tips and examples for other things we needed, but not for this particular one.  I have also looked at 50 or so other links, and still no luck.  There are reports that ""issueFunction in linkedIssue Of("Subquery", "Link description") have worked for some, and while I can filter in the Issue Navigator using this, it does not work for me as a Simple Script Condition/Validator. We are (still) using JIRA 6.2 and Script Runner 2.1.17, with upgrades planned later this year.

0 votes
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.
May 27, 2016

Suggest an answer

Log in or Sign up to answer