changing status in a post function

I have many status's in my workflow and one status for 'On Hold' I use a hidden field to hold the name of the status that the issue was on before being put on hold. That way when I return from on hold I can send the issue back to the status it came from automatically. I copy the value form the hidden field into the Status and it goes to the right place in the workflow. The history does not reflect what has just happened. It seems like the history is written with the first function which assigns the target status to whatever the arrow points to on the workflow diagram. I can redirect it but the history doesn't seem to know. Any suggestions? I need to be able to do conditional routing. Thanks

10 answers

1 accepted

Accepted Answer
1 vote

Sorted! although a bit complex. I created another status called Release from Hold and created a transition from Hold to Release From Hold. Then created transitions from Release from hold back to the original statuses. Now what happens is that if I am on, say for example Step 3, and put the item on hold: a hidden custom field called source screen is loaded with the text 'Step 3'. If I release it from Hold a post script does a fast track transition using the value in the hidden field to select which transition to use back to the original step, in this case "Step 3". the workflow diagram looks a bit messy but the user doesn't see the screen with all of the different return transitions coming out of it. The history now shows a complete and accurate view of where the issue has been, and for how long. Thanks for the advice anyway guys.

1 vote

No!

You can NOT just set the status of an issue (except when creating them in code like the importers). You MUST go through a transition to change status. It doesn't matter what order you do the post-functions in, you will make a complete mess of your data.

There are ways to do this, but setting the status directly is not one of them.

From memory, the JJUPIN plugin has a neat trick which allows you to appear to be doing something like this, so it might be worth looking at that, but if you just want to use plain Jira to do it, you'll need to set up a transition into each possible status out of "On hold", and then look at using conditions (your stored field is very useful here - you need to say something like "only allow transition back to Open if the custom field says Open was the last status"

in what order are you using the postfunctions?

  • set issue status to the linked status of the destination workflow step
  • status will take the value of <your hidden field>
  • update change history for an issue and store the issue in the database
  • ...

maybe this order will help

Another solution would Misc Workflow Extension Plugin. There you can define transitions to all previous status using the previous status condition. So you always end up in the correct status after the On Hold status.

there is a fast track transition in Groovy Scripts that has been recommended to me, I am trying that now. I take the point about trashing the data by changing the Status, so why does it appear on the list of things you can set, if you can't? Seems a bit odd. I shall report back on how i get on with this Groovy Script. And then move on to trying various plugins as recommended by the good folks on here.

Sorted! although a bit complex. I created another status called Release from Hold and created a transition from Hold to Release From Hold. Then created transitions from Release from hold back to the original statuses. Now what happens is that if I am on, say for example Step 3, and put the item on hold: a hidden custom field called source screen is loaded with the text 'Step 3'. If I release it from Hold a post script does a fast track transition using the value in the hidden field to select which transition to use back to the original step, in this case "Step 3". the workflow diagram looks a bit messy but the user doesn't see the screen with all of the different return transitions coming out of it. The history now shows a complete and accurate view of where the issue has been, and for how long. Thanks for the advice anyway guys.

orted! although a bit complex. I created another status called Release from Hold and created a transition from Hold to Release From Hold. Then created transitions from Release from hold back to the original statuses. Now what happens is that if I am on, say for example Step 3, and put the item on hold: a hidden custom field called source screen is loaded with the text 'Step 3'. If I release it from Hold a post script does a fast track transition using the value in the hidden field to select which transition to use back to the original step, in this case "Step 3". the workflow diagram looks a bit messy but the user doesn't see the screen with all of the different return transitions coming out of it. The history now shows a complete and accurate view of where the issue has been, and for how long. Thanks for the advice anyway guys.

Sorted! although a bit complex. I created another status called Release from Hold and created a transition from Hold to Release From Hold. Then created transitions from Release from hold back to the original statuses. Now what happens is that if I am on, say for example Step 3, and put the item on hold: a hidden custom field called source screen is loaded with the text 'Step 3'. If I release it from Hold a post script does a fast track transition using the value in the hidden field to select which transition to use back to the original step, in this case "Step 3". the workflow diagram looks a bit messy but the user doesn't see the screen with all of the different return transitions coming out of it. The history now shows a complete and accurate view of where the issue has been, and for how long. Thanks for the advice anyway guys.

see above

The fast transition doen't trigger a screen refresh in MS IE. I will eventually try some of the plugins suggested but right now I have no budget for buying anything. Item Closed. Thanks guys

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

24,276 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you