Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to remember the last status of an issue in a workflow?

Prateek Phadke February 26, 2018

In one of my workflows, a requirement is to remember the last status of an issue. Presently an issue can be moved to a status named 'On Hold' from any other status(except done) in the workflow.

In order to enforce the users to move the issue from 'On Hold' exactly into the same status where it came from, The workflow must be able to remember the last status?

Is this doable via a configuration or a plug-in?

I have been suggested a couple of basic options:

1. Have a hidden custom data field and assign a unique number(representing the last status) to this field when issue status changes. When issue moves to 'On Hold' it will have a unique number assigned to the field. Check the value in the field and restrict user to change the status based on the value. Not sure if this will actually work, but a bit sophisticated method.

2. A very crude way to achieve this would be to add a 'On Hold' Status related to each individual status and allow only one transition which is to 'Go back to the previous status' from specific 'On hold' status? So if I have 10 in progress statuses in the work flow, I'll end up creating 10 On Hold statuses. This will surely work, but really a primitive way to do something.

Can someone suggest a better option?

Is there also a way to identify and report on how much time an issues spends in these On Hold Statuses?

2 answers

2 accepted

0 votes
Answer accepted
Nisha Hajamohideen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2018

Please check the link:

Please check the link https://innovalog.atlassian.net/wiki/spaces/JMWE/pages/68878471/Previous+Status+Validator

Seems to be having the use case described in the question.

Select the option Most recent status only, to check the most recent status only.

0 votes
Answer accepted
Mikhail_Kopylov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 26, 2018

@Prateek Phadke, sure, it's quite easy, but a little bit tediously.

In order to move from On Hold to any other previous status, you should have as many transitions from On Hold to those statuses, as number of statuses. 

For example, On Hold -> Open, On Hold -> In Progress, etc.

 

Then you should create a custom condition with a single parameter - required status (I'd suggest write a plugin for it), that will check issue history for the previous status with `ChangeHistoryManager`. For transition On Hold -> Open the condition will have the parameter "Open" and will return true only when the previous status was Open.

See https://docs.atlassian.com/software/jira/docs/api/7.0.5/com/atlassian/jira/issue/changehistory/ChangeHistoryManager.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events