It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Andreas Knecht Community Leader 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 votes
Answer accepted
Andreas Knecht Community Leader 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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Marketplace Apps & Integrations

Join our webinar: “Asset Management: The Role of Context in ITSM” with Atlassian & Riada

  Hi Atlassian Community! This is Teresa from the Jira Service Desk team. On June 19th, I’ll be hosting a webinar “Asset Management: The Role of Context in ITSM” with Atlassian Partne...

178 views 2 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you