Set a Field to be "Required" When "Resolution = Fixed"

Fabio Rodrigues October 15, 2018

I would like to know if there's a way to set a field to be "Required" only when the user selects "Fixed" in the "Resolution" field in JIRA.

3 answers

1 vote
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2018

Hello,

You would need an add-on for it. For example, you could use the Power Scripts add-on:

https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview

There is the Live Fields feature, which lets you manage custom fields and other objects in the create, edit, view issue and transition screens.

You could create a Live Field SIL script like this:

if(argv["resolution"] == "Fixed") {   
 lfShowFieldMessage("customfield_11100", "Field  is required.", "WARNING");   
 lfDisable("editSubmit");
} else {
 lfHideFieldMessage("customfield_11100");
 lfEnable("editSubmit");
}

In this script the field with the 11100 id is required if the Resolution field is set to Fixed

1 vote
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 15, 2018

You would need an app to do it, like Scriptrunner or PowerScript

Fabio Rodrigues October 15, 2018

Thanks Mikael, I'm trying to do that with ScriptRunner Behaviours.

0 votes
Ryan Fish
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2018

@Fabio Rodrigues

Check the field configuration for resolution and the workflow properties.

Workflow properties

Specifying field behavior

Thread: Different Resolution options according to issue type 

 

 

Hope this helps

Fabio Rodrigues October 15, 2018

Thanks Ryan,

With Behaviours I'm able to set the field as required however I didn't find a way to make it required only when the resolution is "Fixed".

Thanks for the links. I will check them.

Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 16, 2018

@Fabio Rodrigues If you're setting it to fixed during the transition the resolution isn't actually set yet. That takes place in the post function when the issue is updated. The script would need to have access to the value selected in the drop-down. That may not be possible. 

Suggest an answer

Log in or Sign up to answer