I need help with the following Script runner code. We need to check the status of a particular subtask before it can be transitioned. When i use the below code the validation doesn't work
passesCondition = true
def subTasks = issue.getSubTaskObjects()
subTasks.each {
if (it.summary =~ "Gap Analysis" && it.status == "Done")
passesCondition = false
}
Break up the two clauses - which one of the summary or status is failing? (or both?)
ok let me try and see.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
both of them are failing. Here is what we are trying to achieve:
On a story we want to validate if the subtask with the summary as "Gap Analysis" has a status "Done" before the story can be transitioned. The story has 3 subtasks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I was sort of expecting the status one to fail, not both. Try
"Done".equals(it.getStatus().getName())
That's the raw Java of what you're doing that explicitly gets and tests strings. I think you'd do the same for summary but with "contains" rather than "equals"
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.
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.