Details
-
Bug
-
Status: To Do
-
Low
-
Resolution: Unresolved
-
None
-
None
-
1
Description
Summary
When specifying a field to be read-only dependent on the status, if an issue is transitioned from a read-only status to the editable status, then experiences an error with a user picker field, the field becomes read-only.
Steps to Reproduce
- Create a custom field (I used single-line text for testing).
- Create a behaviour. Add the newly created custom field into the Behaviour and use a script similar to this :
def field = getFieldById("customfield_XXXX") def status = underlyingIssue.status.name if (status != null && status != "Status_A") { field.setReadOnly(true) } else { field.setReadOnly(false) }
- Open some issue with status "Status_B" (any status other that "Status_A").
- Click "Edit" button to open edit dialog. Click the "Update" button.
- Transition the issue into the status "Status_A", and click "Edit" button to open edit dialog.
- Input an invalid username in a user picker field (I used the system field "Assignee" for this test) and click "Update" button.
- The edit dialog is still open with the error message, and the customfield becomes readonly.
Video recording is attached.
Expected Results
Custom field will be editable as long as the issue is in Status_A
Actual Results
Custom field becomes read-only if the above conditions are met
Notes
- In step 4, if the user does not click on 'Update' and instead transitions directly to Status_A, the issue will not occur.
- Tested in JIRA 9.3.0 with ScriptRunner 7.6.0