Okay, so the real issue is that JIRA sees script fields as nothing more than a script field, regardless of what "type" of script field it is, so even though I already have a number script field that provides this value, it can't actually be used in filters because the only available filter is if its EMPTY or not.
SO I want to use the script in the scripted field, to also set the value of a number field. is this at all possible? Currently my workaround is to have a second script field that is empty if the number field and number script field are equal, and then a custom rule that looks for the second script field to be non empty, and if it is, then it updates the number field to equal the scripted number field. This is WAY more complicated than it needs to be. Is there a way I can just use the scripted field to set the number field?
def subtasks = 0
for (i in issue.getSubTaskObjects()){
if (i.getStatus().getName() != "Closed"){
subtasks += 1
}
}
if (subtasks == 0 )
if (issue.getStatus().getName() != "Done"){
subtasks = 1
}
return subtasks
it would be nice if I could just have a line like
issue.updateCustomField(16340, subtasks)