Display Previously Held Status

Issue #118 resolved
Will created an issue

Display the previous status of an issue when it is on the 'On Hold' status. That way the user knows which status to return to when it is removed from On Hold.

Can you improve this further by only allowing the issue to be returned to the previously held status somehow?

Comments (9)

  1. Fidel Castro Armario repo owner

    QUESTION 1: Display the previous status of an issue when it is on the 'On Hold' status. That way the user knows which status to return to when it is removed from On Hold.

    ANSWER: Follow the following instructions:

    1. Create a "Text Field (single line)" custom field called "Previous Status".
    2. Include the new custom field in issue's view screen.
    3. Inserting "Copy a parsed text to a field" post-function into all transitions whose destination status is "On Hold". Use the following configuration: conf-1.png

    Notice that %{00138} is field code for "Previous issue status" virtual field.

    You can also refine the solution by adding "Copy a parsed text to a field" post-function into all transitions whose source status is "On Hold", in order to clean "Previous Status" custom field when leaving "On Hold" status. To do it use the following configuration:

    conf-2.png

  2. Fidel Castro Armario repo owner

    QUESTION 2: Can you improve this further by only allowing the issue to be returned to the previously held status somehow?

    ANSWER: You can do it by inserting "Boolean condition with math, date-time or text-string terms" condition into all transition whose source status is "On Hold".

    You have to configure in each of those transitions a condition for checking that "Previous issue status" virtual field (field code %{00138}) is equal to destination status for each of those transitions. Destination status is written as a string literal in each boolean expression.

    EXAMPLE: Let's suppose a transition "Resume progress" from "On Hold" status to "In Progress" status.

    In this case we will add "Boolean condition with math, date-time or text-string terms" with the following boolean expression:

    %{00138} = "In Progress"
    

    Look at the screenshot:

    conf-3.png

  3. Will reporter

    Will <answer to Question 2> inhibit those statuses from being transitioned to from other statuses? In other words: Will 'Open', still be allowed to go in to 'In Progress' if an 'In Progress' issue was kicked back to 'Open' and then someone restarted progress? Seems the workflow would check to see if the previous status was 'In Progress', and then fail. Or am I misunderstanding this?

    Sorry for so many questions.

  4. Fidel Castro Armario repo owner

    Sorry, I supposed you were using different transitions from each source status, but I see you are sharing the same transition for transitioning to "Open" status from other statuses.

    In this case you should use the following boolean expression in order to make it work only from "On Hold" status:

    %{00016} = "On Hold" IMPLIES %{00138} = "In Progress"
    

    Notice that %{00016} is field code for "Issue status" virtual field.

  5. Will reporter

    That makes sense, thanks.

    I currently have several transition OUT of On Hold to basically all other statuses (except for Closed). I can't replace that with just one transition out to return to the previously held status can I?

  6. Will reporter

    Everything is working as expected. I'll just add for anybody reading this that I was able to fake a one-button "Resume" transition back to the previously held status simply by setting the label for each transition out of On Hold to "Resume." Jira will not allow you to name two transitions in a step identically so to work around this you just need to add a blank space in front of the label and it will be accepted as a new transition. Add multiple blank spaces if needed. The blanks will be trimmed throughout the UI.

    The condition placed on the transition (provided by Fidel, above) hides the other workflow transitions from view.

  7. Log in to comment