Prevent issue to reopen after X days

Issue #645 resolved
laujmimna created an issue

I am interested in trying to prevent users from reopening a ticket after 30 days it’s been closed. I read more about it on, https://bitbucket.org/fcarmario/jira-workflow-toolbox/wiki/amazing/Validation%20and%20Condition%20Based%20on%20Time%20Expressions and am not sure how to accomplish this. I know that I want this to happen during the ‘Reopen’ transition. Would you be able to help me with this.

Thank you.

Comments (18)

  1. Fidel Castro Armario repo owner

    Hi @laujmimna,

    You should add "Boolean validator with math, date-time or text-string terms" to "Reopen" transition with any of the following boolean expressions:

    1) Less than 30 days since issue resolution

    {00057} - {00112} < 30 * {DAY}
    

    2) Less than 30 days since issue passed to "Closed" status

    {00057} - last(timesOfTransition("", "Closed")) < 30 * {DAY}
    

    Note that:

    • {00057} is field code for Current date and time.
    • {00112} is field code for Date and time of resolution.
    • "Closed" is a string with the exact name of the closed status. Take into account that JIRA always shows the name of status in upper case. You should use the exact name, which can be checked up in status administration section of JIRA.
  2. laujmimna reporter

    Hi Fidel, Quick question. How can I allow it so that while in Jira Core, the ticket cannot be reopened after x amount of days so that the customer from the Service Desk is not able too?

    Thanks,Erica

  3. Fidel Castro Armario repo owner

    Hi @laujmimna,

    The validator applies to any user who is trying to execute the transition, regardless of whether he is a JSD customer or JIRA Core user.

    If you are experiencing an undesired behavior in the validation, please, describe it in detail, and attach a screenshot of the workflow you are using, or the part of it related to the transition where you inserted the validator.

  4. laujmimna reporter

    Thanks Fidel. I have a status "Escalate" set up to 'not re-open after x amount of days' from Jira Core.And I cannot open as expected. But on the Service Desk with that same ticket, I was able to reopen. Is there a configuration I'm missing?

    Thanks, Erica

  5. laujmimna reporter

    Thanks Fidel. I see an import but not an export. Is there a process you have that I can help deliver this file for you?

  6. Fidel Castro Armario repo owner

    Hi @laujmimna,

    You have 2 transitions that can make issue leave Closed status:

    • Reopen, which has a boolean condition that blocks the transition after 14 days.
    • Escalate, which is a global transition and doesn't have any condition or validator.

    You should add a boolean condition or validator in global transition Escalate with the following expression:

    %{00016} = "Closed" IMPLIES {00057} - {00112} < 14 * {DAY} 
    

    Where:

    • %{00016} is field code for Issue status.
    • {00057} is field code for Current date and time.
    • {00112} is field code for Date and time of resolution

    Note that since Escalate is a global transition, we have to use term %{00016} = "Closed" IMPLIES ... in order to limit condition related with time (i.e., {00057} - {00112} < 14 * {DAY}) only to Closed status.

  7. laujmimna reporter

    open-esca.png

    This error also occurs on the Escalate status when the issue is still open. I am not sure how to trigger after it's been closed and not open.

    Thank you for all your help.

    Erica

  8. Fidel Castro Armario repo owner

    Use this boolean expression instead:

    {00112} = null OR (%{00016} = "Closed" IMPLIES {00057} - {00112} < 14 * {DAY})
    
  9. Log in to comment