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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.