I'm struggling to get the following (partial) code working for a ScriptRunner Behaviour. In the issue create screen when the first set of criteria is met, JIRA does show that the 3 fields in question are no longer required by removing the red * next to them. However, it still won't let the user proceed and pops up a message saying those 3 fields are required....
if (sportsPageType == "In App" && vertical.size() == 1) {
imagesRequiredField.setRequired(false)
exposureRequiredField.setRequired(false)
}
else {
imagesRequiredField.setRequired(true)
exposureRequiredField.setRequired(true)
}
Anyone ever seen that before? Where it removes the required * flag successfully but the field is still somehow required? Driving me bonkers.
The fields in question are radio buttons in this example. Is the problem that I have the custom fields set to REQUIRED in JIRA itself? This is because they need to be required for other configuration variations.
If that's the problem I guess I could make them optional but I want to force the user to make a selection and don't want to present a default value. But I also don't want JIRA injecting an automatic None option when they are optional with no default value.
Could I make them optional in JIRA with a default value set but then reset that to a null value in my ScriptRunner Behaviour for the field to effectively reset it, forcing the user to select one or other?
This does sound like a conflict between the behaviour and Jira. Try to mark them optional in Jira and use the toggle button to mark them required in your behaviour. Then in the script you can write your logic to un-require them whenever needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.