Set a mutiselect list custom field value as mandatory
Use a ScriptRunner post function to set a custom field value. The documentation shows how to set a default value for a select list.
Step-by-step guide
- Type '.' and then Behaviours
- Type in the name of your Behaviour (call it say "Select List - multiple mandatory")
- Add a new behaviour
- Choose the Fields link
- Create initialiser and use the code in the block below
- Or if you don't wish to use the code - choose to "Add the field and mark it as mandatory"
// Get a pointer to both my fields def demoSelect = getFieldByName("Demo Select List") def demoMultiTxt = getFieldByName("Demo Multi Line Text Field") // Get the Value of the Select List Field def selectedVal = demoSelect.getValue() if (selectedVal != null){ demoMultiTxt.setRequired(true) }
- Replace "Demo Select List" with the actual name of your select list custom field
- Using the code is recommended over the GUI of adding a field since you can add conditions and much more in the future
Related articles