Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Make mandatory custom fields empty during creation screen when switching between issue types

Balazs_Devay
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 8, 2026

I want to implement a feature.

 

GIVEN

- custom, mandatory field (multi-select drop-down list): CMF, and

- CMF is presented on the creation screen and visible, and

- Script Runners - Behaviours is available

WHEN

- the user creates a new Jira work item, and

- the default work item (A) is selected automatically, and

- user selects a different issue type (B) on the creation screen

THEN

- the value of the CMF is reset to empty

 

I tried the following, but these trials all fail without throwing an exception, but UI displays the error: "We encountered an error while applying UI modifications to this form"

- CMF.setValue(null);

- CMF.setValue("");

- CMF.setValue([""]);

 

I also tried this but it didn't help:

CMF.setRequired(false)

CMF.setValue(null);

CMF.setRequired(true)

 

Please help me understand what's the proper way to reset a visible mandatory custom field to empty.

1 answer

0 votes
Prasanna Ravichandran
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 Champions.
May 9, 2026

Hi,

Mandatory fields in Jira cannot always be reset to empty dynamically during issue creation, especially when the field is marked as required in the Field Configuration.
With ScriptRunner Behaviours, clearing a visible mandatory field often causes the UI modification error you are seeing.
A better approach is to keep the field optional during create and enforce it later using a Workflow Validator or transition screen based on the issue type/status. Hope this helps.

Suggest an answer

Log in or Sign up to answer