It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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. 

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
Community showcase
Posted in Portfolio for Jira

Program managers, we need your help! We want to learn about how you plan work for a team of teams

Hi community members, My name is Erika and I’m a product manager at Atlassian. We’re currently investigating how teams are planning work at the program level. We understand that every team in a tea...

145 views 0 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you