Details
-
Bug
-
Status: Done
-
High
-
Resolution: Fixed
-
5.1.8
-
None
-
ScriptRunner| 5.1.8 |
JIRA Software| 7.5.0 |
-
0
Description
Whenever the Fix Version/s field is set to required by a Behaviour (either via a server-side script or simply through the UI) and then subsequently set to be not required by the setRequired(false) method, the red asterisk does not disappear. Furthermore, when checking the requirement of the field via the isRequired() method, the method will return false; yet the asterisk persists and you are able to submit the form with no visible errors to the browser console or JIRA logs.
Steps to Reproduce:
- Create a new screen with the Fix Version/s field and some other single select field (i.e. the Resolutions field). Then attach that screen to some transition in your project's workflow.
- Then set a behaviour on the select field that looks something along the lines of:
import com.atlassian.jira.issue.resolution.Resolution def resolutionField = getFieldById("resolution") def fixVersionsField = getFieldById("fixVersions") def resolution = resolutionField.getValue() as Resolution if (resolution.name == "Done") { fixVersionsField.setRequired(true) log.warn("Is fix required?: "+fixVersionsField.isRequired()) } else { fixVersionsField.setRequired(false) log.warn("Is fix required?: "+fixVersionsField.isRequired()) }
- Go to an issue and attempt to transition it via the transition that you set the screen on.
- On the transition screen, set your select field to the option that triggers the Fix Version/s field to be set as required. Then select some other option in the select list to then trigger the behaviour to set the Fix Version/s field to be not required.
- Notice that the red asterisk to the left of the field is still present even though the logs will protest that the field is not required. You can then continue on and submit the form as you would normally.
Attachments
Issue Links
- is related to
-
SRJIRA-2341 Setting linked issues field as not required in behaviours does not unmark the field as required
-
- Done
-