Forums

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

When issue is transition to done, delete after 48 hours

John To
April 12, 2022

Hi Atlassian community,

Hope everyone is doing okay.

I am trying to set an automation rule in my project, the rule is that:

- Trigger: when issue is transition to done

- Condition: it has been 48 hours since it was transitioned

- Action: delete issue

 

So basically I'm stuck at the condition part. How do you determine it has been 48 hours? And also, what if it is Thursday/Friday, how can Automation determines it is weekend so the rule should not run or more like: what the calculation should look like?

 

Kind regards,

John

1 answer

1 accepted

1 vote
Answer accepted
Jack Brickey
Community Champion
April 12, 2022

First, are you sure you wish to delete issues? As you are likely are aware once deleted all history of its existence is gone.

with that said...

I would suggest you set up a daily automation rule and select the checkbox to run JQL and execute on the results.

 resolutiondate <= startofday(-48h) And ???

??? = your additional criteria to operate only on the issues desired

John To
April 12, 2022

Thank you, Jack Brickey. 

You raised an interesting point, I really need to double check with the team members to see whether if they really want to delete the issues or not. The only thing I recalled was "making the issues in done column disappear".

 

In terms of JQL query, I'm not sure resolutiondate is one of the fields in Jira issue.

John To
April 13, 2022

Hi Jack, 

thank you for your valuable response.

I just want to ask that if it the issue is done on Friday, then resolutiondate < startofDay(-48h) will delete the issue on Sunday. Is there anyway to make the JQL run specifically on Business Day?

Thank you.

Jack Brickey
Community Champion
April 19, 2022

JQL does not accommodate business days. One option would be to create a custom field and set it using automation since automation can consider business days using smart values. There are a number of posts on how to leverage Automation with business days and I encourage you to seek those out if this is of interest.

Like John To likes this
John To
April 25, 2022

thank you Jack :D

i have figured out after surfing the community for answers :)

Suggest an answer

Log in or Sign up to answer