Workflow: Closing a large number of tickets

<p>Use an automation or the application programming interface (API) to close tickets in bulk. This archives the tickets and removes them from your views.</p><p>This article covers these sections:</p><div style="margin-bottom: 20px; text-align: right;">
<button id="master-toggle" class="btn fw-semibold text-dark" data-action="expand" style="background-color: #DEF991; border: none; outline: none; border-radius: 7px; padding: 10px 20px; font-size: 15px; transition: background-color 0.2s ease;" onmouseover="this.style.backgroundColor='#cbef6d'" onmouseout="this.style.backgroundColor='#DEF991'">
Expand all tabs
</button>
</div>
<script>
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';
}
});
});
</script><div class="accordion"><h3 id="h_01J4S57F3B0GX3YVNN2FCVKJRN">Close tickets with the API</h3></div><div class="panel">
<p>Use the API to close a large group of tickets. You can use the <a href="https://support.zendesk.com/hc/en-us/articles/6561144266906-About-the-Advanced-Data-Privacy-and-Protection-add-on" target="_blank" rel="noopener noreferrer">Advanced Data Privacy and Protection (ADPP)</a> add-on or the <a href="https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/" target="_blank" rel="noopener noreferrer">ticket API endpoint</a>.</p>
<p><strong>Create a deletion schedule for advanced data retention policies</strong></p>
<p>With the advanced data retention policies of the <strong>ADPP</strong> add-on, you can create a <a href="https://support.zendesk.com/hc/en-us/articles/6388012977306-Creating-multiple-ticket-deletion-schedules-for-advanced-data-retention-policies-ADPP-add-on" target="_blank" rel="noopener noreferrer">deletion schedule</a> based on your ticket's <strong>Last Updated</strong> date and <strong>Brand</strong>. After you activate a schedule, it searches for and deletes tickets or end users that meet the conditions.</p>
<p><strong>Use the API to bulk close tickets</strong></p>
<p>Use the <a href="https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/" target="_blank" rel="noopener noreferrer">ticket API endpoint</a> to find and manage tickets. For more information about the API, see <a href="https://support.zendesk.com/hc/en-us/articles/4408827565338-Admin-s-guide-to-the-Zendesk-API" target="_blank" rel="noopener noreferrer">Admin's guide to the Zendesk API</a>.</p>
<p>If you're new to APIs, use <a href="https://www.postman.com/downloads/" target="_blank" rel="noopener noreferrer">Postman</a> to send a request to your Zendesk Support account. For steps to use Postman to make API requests to your Zendesk account, see <a href="https://support.zendesk.com/hc/en-us/articles/4408826991642-How-do-I-set-up-Postman-to-make-API-requests-to-my-Zendesk-account" target="_blank" rel="noopener noreferrer">How do I set up Postman to make API requests to my Zendesk account?</a>.</p>
</div><div class="accordion"><h3 id="h_01J4S5EQA653R7GYAR2XEYP46M">Create an automation to set ticket status to closed</h3></div><div class="panel">
<p>Use an <a href="https://support.zendesk.com/hc/en-us/articles/203662126-Creating-and-managing-automations-for-time-based-events" target="_blank" rel="noopener noreferrer">automation</a> to create a time-based rule that closes your tickets.</p>
<p>To create this automation:</p>
<ol>
<li data-list-item-id="e36b5b31a2374eaa045f1b0be4715c7f3"><a href="https://support.zendesk.com/hc/en-us/articles/203662126-Creating-and-managing-automations-for-time-based-events" target="_blank" rel="noopener noreferrer">Add a new automation</a></li>
<li data-list-item-id="e5aa9615b8cf4d831ca4bfe89c18aa377">Name the new automation</li>
<li data-list-item-id="e3d4a2eefcde198496a2df6d6cd887a9d">Add these conditions under <strong>Meet all of the following conditions</strong>:<ul>
<li data-list-item-id="ed4a55fc61cf01c081237e118be63b705">
<strong>Ticket: Hours since update</strong> &gt; <strong>Greater than</strong> &gt; (Specify the time here). If the tickets you want to close have a specific status, use other conditions such as <strong>Ticket: Hours since open</strong>, <strong>Ticket: Hours since pending</strong>, and <strong>Ticket: Hours since solved</strong>.</li>
<li data-list-item-id="e1b276c4ec348b8cbbc7a66d95ca068eb">
<strong>Ticket: Status category</strong> &gt; <strong>Less than</strong> &gt; <strong>Closed</strong>
</li>
</ul>
</li>
<li data-list-item-id="e13e24510a66011c365e4a51f8fcff6d4">Under <strong>Perform these actions</strong>, select <strong>Ticket: Status category: Closed</strong>
</li>
<li data-list-item-id="ebc005c266dfacbca27e1d4583f5ec2ce">Click <strong>Create automation</strong>.<br><img class="wysiwyg-image-resized" style="aspect-ratio: 1970/1130; width: 64.42%;" src="https://support.zendesk.com/hc/article_attachments/10882250711322" alt="Close tickets hours after update.png" width="1970" height="1130">
</li>
</ol>
<div class="note">
<span class="notetitle">Note:</span> In accounts with <a href="https://support.zendesk.com/hc/en-us/articles/4412575861018-Creating-custom-ticket-statuses" target="_blank" rel="noopener noreferrer">custom ticket statuses</a> deactivated, use the condition <strong>Ticket: Status</strong> instead of <strong>Ticket: Status category</strong>. For the actions, use the action <strong>Ticket: Status | Closed</strong>.</div>
</div>