Introduction:
Jira natively allows users to archive work items, but only one by one. There is currently no option to archive work items in bulk through the standard user interface. We have created an automation rule to overcome this limitation, allowing you to label multiple work items at once for automatic archival, without having to manually process each ticket.
Steps to execute:
To archive a group of work items, follow these steps:
Note on Sub-tasks: Due to Atlassian's native limitations, it is not possible to archive a sub-task. You can archive its parent work item. This will automatically archive any sub-tasks attached to that parent work item. Consequently, if you apply the force-archive label to a sub-task, it will be ignored by the automation.
IMPORTANT: The automation processes a maximum of 100 work items per execution (during the nightly windows). To handle larger backlogs of archival requests, the rule runs every 10 minutes between 22:00 and 06:00 (UTC).
Technical Instructions:
Suggested Rule Name: Bulk Archive Issues with force-archive label
Trigger type: Scheduled
Action: Lookup Issues: The automation looks up issues matching the following JQL query:
labels = force-archive AND issuetype NOT IN (subTaskIssueTypes())
If (compare two values) condition:
First value: {{lookupIssues.size}}
Condition: does not equal
Second value: 0
Log action:
{ "issueIdsOrKeys": [ {{#lookupIssues}}"{{key}}"{{^last}}, {{/}}{{/}} ] }Send web request:
{
"issueIdsOrKeys": [
{{#lookupIssues}}"{{key}}"{{^last}}, {{/}}{{/}}
]
}You can read more about the Service Accounts authorization here,
and how to create OAuth 2.0 credentials for service accounts: here
Permissions:
If you have any questions, please feel free to comment on this post!
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Improve user experience across Jira with global settings
Learn how to set up and configure a Jira site, manage Jira permissions, and configure Jira apps and integrations.
Learning Path
Streamline projects across Jira with shared configurations
Build Jira work items with reusable configurations called schemes, and reduce administrative work with automation.
Learning Path
Become an effective Jira software project admin
Set up software projects and configure tools and agile boards to meet your team's needs.