Can I archive issues to another project using Automation for JIRA?

Andreas Knecht Community Champion Sep 19, 2016

I would like to copy old issues to an 'archive' project once they've been closed for a while and delete them in the current project. Can I do this with Automation for JIRA?

1 answer

1 accepted

0 vote
Andreas Knecht Community Champion Sep 19, 2016

Yes, you can do this with a "Scheduled JQL trigger" and "Clone issue action".

Here's what your rule setup would look like:

Project automation - Code Barrel JIRA 2016-09-20 10-16-14.png

So we have a JQL Scheduled trigger that looks for "Done" issues older than 10 weeks, that we run every 7 days.  These issues are then cloned to our "Archive" project.

Now unfortunately JIRA's APIs make it a bit difficult to preserve things like the comment history (because we can't add comments to the cloned issue as other users and using different dates, but fortunately we can cheat a bit here using the power of smart-values:

Project automation - Code Barrel JIRA 2016-09-20 10-17-56.png

The important bit is the Advanced section:

{
	"fields": {
        "description": "{{{issue.fields.description}}}\n\n*Comments*\n{{#issue.comments}}By [~{{{author.key}}}] - {{created}}\n{quote}{{{body}}}{quote}\n\n{{/issue.comments}}"
    }
}

This simply iterates through all the comments of the original issue and adds them to the description of the cloned issue like this:

[AR-9] This needs log files! - Code Barrel JIRA 2016-09-20 10-19-30.png

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

268 views 0 6
Read article

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