When custom field IT Release is set to 'Emergency Migrate'
Within a workflow, rather than going A -> B -> C
to going A -> C
Your help is appreciated!Janene
JIRA 6.3.7Scriptrunner
Off the top of my head, you can add a post-function to the A -> B transition of type "Fast-track transition an issue" (a Script Runner transition, I believe). I haven't used it in awhile; my use-case was transitioning to status "Open" if an issue was created by someone in the developer's role, but I'd imagine you can check the value of a custom field as the condition/trigger for the transition.
Oh, actually... maybe I'm reading the request wrong. All you have to do here is add a condition to the A -> B transition such that it isn't available if the custom field is set, and add a direct A -> C transition with the reverse condition (that the field be set instead of not be set). If on A and the custom field is set, you'll see the C transition, otherwise you'll see the B transition.
When I use Post-functon / Fast track transition an issue, I get an error message:
It seems that you have tried to perform a workflow operation (Deployment Approved) that is not valid for the current state of this issue (CM-218). The likely cause is that somebody has changed the issue recently, please look at the issue history for details.
first of all, nobody else is editing the issuesecondly, I've validated the condition of my script to be true, but yet the post function script won't execute because it throws the above error Augh - your insight is appreciated!
I've experienced that using the "Fast Track" method in the past, but it was sporadic, and the transition itself always did take place. Well, at least, the original transition did; in hindsight, I don't think I noticed if it fast tracked or not. I've been assuming that there is a race of some kind in play, but I hoped it was specific to the "Create" transition, and so didn't mention it.
If you are getting that 100% of the time, then it suggests that the transition you are attempting really isn't valid. Could there be something preventing the B->C transition from taking place? Where is your "fast track" in the post function list? It would have to come after at least the original change, or else it is going to try to do A->C (and fail if invalid), then try to do B->C while already at C (if A->C was valid), or something along those lines.
It looks like you're new here. Sign in or register to get started.