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

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

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

242 views 1 18
Join discussion

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