The Issue Archiving Job is only available on Data Center 8.1 and above.

Automate the archiving of issues with a ScriptRunner Issue Archiving Job. Periodically archive issues based on a JQL query. For example, you want to archive any issues that are closed and have not been updated in over two years. This will improve performance and reduce the risk of users viewing Jira issues that are no longer relevant.

After archiving, issues cannot be found by searching, and they become read-only.
  1. From ScriptRunner, navigate to the Jobs tab and click Create Job→Issue Archiving Job.

  2. In Note enter a description for the job, for example, Archive old issues.

  3. Under User, enter the user the job will run as.

    Create a user called Automation (or similar) and give it administrator rights in every project. Then set Automation as the User when setting up an issue archiving job.
  4. In the Interval/Cron Expression field, enter how often the job should run. The interval can be in minutes, entered as an integer, or a cron expression. The example below runs on the first Monday of every month.

    issue archive cron
    Jobs set to run at intervals run automatically upon start-up of Jira. To avoid this, use non-interval cron expressions specifying the time the job should run (as seen in the example above).
    For more information on cron expressions, see Constructing Cron Expressions for a Filter Subscription.
  5. In JQL Query, enter a query to select the issues you wish to archive. For example, issues in a specific project that have the status Closed and have not been updated for over two years.

    issue archive jql
    Test the query in the Issue Navigator first. The query runs as the configured user, and therefore, due to permissions, may see different results from the current user. For more information on JQL queries, see Advanced Searching.
  6. Click Add to save the job; the script will run on the interval specified. Optionally, click Run Now to run the script and view which issues were affected.

    Clicking Run Now does not save the job. Click Add to save.
See the Atlassian documentation for details on how to restore issues.

Have questions? Visit the Atlassian Community to connect, share, and learn with other Atlassian users and experts, including Adaptavist staff.

Ask a question about ScriptRunner for JIRA, Bitbucket Server, or Confluence.

Want to learn more? Check out courses on Adaptavist Learn, an online platform to onboard and train new users for Atlassian solutions.