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

Tomas Arguinzones 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] Community Leader 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 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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

2,191 views 6 15
Read article

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