Can I require a field be populated based on specific resolution values?

We have a text field we would like to be populated on resolve/close but only when the resolution is fixed, complete, or cannot reproduce.  Is this possible?

1 answer

0 vote
Vasiliy Zverev Community Champion Jan 23, 2017

you could create 2 transitions: 

  • fixed, complete, or cannot reproduce
  • other

And use 2 diferent transition screens and validators.

 

Thanks, but that's really not what we're looking for.  We need a validator that incorporates conditional logic.

Vasiliy Zverev Community Champion Jan 25, 2017

This is a script for simple script validator:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField

switch (issue?.getResolutionObject().getName()){
    case "fixed": case "complete": case "cannot reproduce":
        CustomField textField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("field name")
        return issue?.getCustomFieldValue(textField) != null;
            
    default:
        return true;           
}

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

33 views 0 4
Read article

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