Workflow: Closing a large number of tickets

Use an automation or the application programming interface (API) to close tickets in bulk. This archives the tickets and removes them from your views. This article covers these sections:

Expand all tabs



document.addEventListener('DOMContentLoaded', function () {
const toggleBtn = document.getElementById('master-toggle');

toggleBtn.addEventListener('click', function () {
const action = this.getAttribute('data-action');
const headers = document.querySelectorAll('.accordion');

headers.forEach(header => {
const isActive = header.classList.contains('active');
const panel = header.nextElementSibling; // Grabs the corresponding .panel container

if (action === 'expand' && !isActive) {
// Open it by simulating a standard click
header.click();
} else if (action === 'collapse' && isActive) {
// Close it by simulating a standard click
header.click();
}
});

// Flip button text and states
if (action === 'expand') {
this.setAttribute('data-action', 'collapse');
this.textContent = 'Collapse all tabs';
} else {
this.setAttribute('data-action', 'expand');
this.textContent = 'Expand all tabs';
}
});
});
Close tickets with the API
Use the API to close a large group of tickets. You can use the Advanced Data Privacy and Protection (ADPP) add-on or the ticket API endpoint.
Create a deletion schedule for advanced data retention policies
With the advanced data retention policies of the ADPP add-on, you can create a deletion schedule based on your ticket's Last Updated date and Brand. After you activate a schedule, it searches for and deletes tickets or end users that meet the conditions.
Use the API to bulk close tickets
Use the ticket API endpoint to find and manage tickets. For more information about the API, see Admin's guide to the Zendesk API.
If you're new to APIs, use Postman to send a request to your Zendesk Support account. For steps to use Postman to make API requests to your Zendesk account, see How do I set up Postman to make API requests to my Zendesk account?.
Create an automation to set ticket status to closed
Use an automation to create a time-based rule that closes your tickets.
To create this automation:

Add a new automation
Name the new automation
Add these conditions under Meet all of the following conditions:

Ticket: Hours since update > Greater than > (Specify the time here). If the tickets you want to close have a specific status, use other conditions such as Ticket: Hours since open, Ticket: Hours since pending, and Ticket: Hours since solved.

Ticket: Status category > Less than > Closed



Under Perform these actions, select Ticket: Status category: Closed

Click Create automation.



Note: In accounts with custom ticket statuses deactivated, use the condition Ticket: Status instead of Ticket: Status category. For the actions, use the action Ticket: Status | Closed.
