Validator to make a "Required" Custom Field to be "Optional" only in the Create Issue Transition

I have a use case which requires a Single Select - Single Choice Custom Field to be “Required” in every transition and in every status except the Create Issue Transition. I would like to know how to use a Behaviour or Validator to make the Custom Field “Optional” during the Create Issue Transition only as it is set to “Required” in the project Field Configuration and must be Required after issue creation.

I created a Behaviour to set the Custom Field "Optional" during the Create Issue Transition. I mapped the Behaviour to the Story Issue Type and my test project. My Behaviour code is below:

def selectCFValue = getFieldByName("CPM:Type of Change?").getValue()
def cpmTypeOfChange = getFieldById("customfield_12085")

if (selectCFValue != "NULL")
    cpmTypeOfChange.setRequired(true)
else
    cpmTypeOfChange.setRequired(false)

Testing the Behaviour failed with the CPM: Type of change?: CPM: Type of change? is required - Error Message at the top of the Create Issue Screen.

I also used the JIRA Suite Utilities Field Required Validator to attempt to make the "Required" field optional. This provided the same error as above.

The Custom Field is not on our Create Issue Screen but is on our Edit and View Screen for managers to categorize the Reporters input. We want to force the field to contain a selection at all times after issue creation.

Comments and suggestions on how to accomplish the use case will be gratefully accepted and appreciated.

Thank you,

Joe

0 comments

Comment

Log in or Join to comment
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,799 views 11 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot