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

Script validator to ensure if project = ABC, sprint field is NOT empty?

I'm making a simple script validator with Script-Runner on a workflow transition, and I want to ensure if project "ABC" or "DEF" is selected then the Sprint field should not be empty.

I can't find documentation on how to write something like this.
Could someone help me out with this? 

1 answer

1 accepted

1 vote
Answer accepted
if (issue.projectObject.key in ["ABC", "DEF"]) {
    return cfValues["Sprint"]
else {
    return true

Exactly what I was looking for. 
Is there any detailed document for future references? So far i've seen just some particular examples.


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

1,980 views 8 3
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