validator to allow transition only if epic has at least one child

Tomas Arguinzones Yahoo May 22, 2018

Hi...I need a validator to allow a transition only if the epic has at least one child. I tried to  use one of the examples under the simple scripted validator section in scriptrunner (Has at least one outward duplicate link) and adapted it to what I need but it does not seem to work:

issueLinkManager.getOutwardLinks(issue.getId())*.issueLinkType.name.contains('is epic of')

 

I also changed it from Outward to Inward to see if that made a difference but still no luck. Maybe it can not be done like that and it needs an actual script? If so, any ideas?

 

Thank you

1 answer

1 accepted

1 vote
Answer accepted
Thanos Batagiannis _Adaptavist_
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 23, 2018

Hi Tomas, 

If there is at least one child in the epic then the following will return true 

ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.id)?.find {it.issueLinkType.name == "Epic-Story Link"}

Which is similar to what you have with the only difference the epic link type name. 

Tomas Arguinzones Yahoo May 23, 2018

Hi Thanos....it works.

As always, thank you very much!

Please close the related request in you support site as well

Suggest an answer

Log in or Sign up to answer