Details
-
Bug
-
Status: Done
-
L3
-
Resolution: Fixed
-
6.10.0
-
None
-
SR4J Sprint 89
-
4.7
Description
Behaviours mapped to the "Use Service Desk mapping" type on a RadioButton or CheckBox custom field still displays "optional" in the customer portal whenever calling setRequired(true) on those fields
Steps to reproduce:
- Create a SD project
- Create a RadioButton or CheckBox custom field
- Add the field to the customer portal screen
- Create a Behaviour with the "Use Service Desk mapping" and mapped to "All request types"
- Click on the cogwheel on the Behaviour > Edit
- a. Click on 'Add Field' > select the RadioButton or CheckBox custom field > Add
Then click on the 'Optional' toggle button to make it 'Required' > Save
- Go to the customer portal in the created SD project and notice the "(optional)" text and the none option on the field which shouldn't be there as the field is set to required
6. b. Alternatively,
In the initialiser paste this code
getFieldByName(FIELD_NAME).setRequired(true)
- Update by Lih Yao:
This happened while using behavior on setlabel and setDescription on RadioButton as well.
For example:getFieldByName("RadioButton").setDescription("abc") getFieldByName("RadioButton").setlabel("abc")
I've done a few tests (only for setlabel() and setDescription()) on different versions:
Working Version: Jira Service Desk: 3.16.8, Scriptrunner: 6.5.0
Not working Version: Jira Service Desk: 4.13.1, Scriptrunner: 6.13.1