We are looking for a way to limit the input of the Story Points field to be > 0 but less than 99 so that if a person fat fingers a value we do not have a LARGE number in point history
I tried creating a behavior but did not work
def cs = getFieldByName("Story Points")
if (cs.getValue().toString().length() > 99) {
cs.setError("Story Point > 99")
cs.setRequired(true)
} else {
cs.setError("")
cs.setRequired(false)
}
Your code must be like this
def cs = getFieldByName("Story Points")
if (Integer.valueOf(cs.getValue().toString()) > 99) {
cs.setError("Story Point > 99")
cs.setRequired(true)
} else {
cs.clearError()
cs.setRequired(false)
}
You should add the Story Points field to your behaviour and set the script for the field.
Question - noticed with the behavior that in the Edit Detail screen or clocking the field to change the value - it now bring up the edit screen and lose the ability to just edit the field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Behaviour do work like this. If you click on a filed in the view issue screen then the edit issue screen will be opened. You can read about it here
https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html#_screens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.