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 votes
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
Community showcase
Posted Dec 10, 2018 in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

204 views 6 7
Join discussion

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