Hello,
I have added transition in a workflow from status "In Review" to "QA Open". This transition set with option triggers "Automatically transitions the issue when a related pull request is merged".
I noticed that Triggers will ignore Conditions and Validators.
Atlassian support suggest to create groovy script to be add in ScriptRunner in Post Function.
I am quite new in creating this groovy script. Does anyone has script example to check sub-task status in Post-Function and script example to stop from proceed transition.
Thanks Steve,
As your suggestion, I have created 2 transition.
It works like charm :)
Glad to hear it worked :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Farhan,
This might be quite straight-forward in your use case. You could use a built-in script called "Fast-track transition an issue" with a condition added to it. That would limit the amount of Groovy that you need to write.
You can find a good example of it in the documentation https://scriptrunner.adaptavist.com/5.2.4/jira/builtin-scripts.html#_fast_track_transition_an_issue
This approach works by transitioning the issue back to its original state rather than "stopping" the transition (hopefully this would work for your use case).
Here is an example of some code that will retrieve the sub-tasks for an issue that you can use in the condition field. You just need to add the condition that you want to check on and return the relevant value (see built-in examples for condition field)
issue.getSubTaskObjects().each{ subtask ->
println(subtask.id)
}
I hope this helps!
Steve
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.