Workflow: How to manually close a ticket

Admins and agents sometimes want to force a ticket status to Closed for these reasons:
Closed tickets can't be modified in any way

Business rules may make changes upon or after a ticket is solved
The Zendesk application programming interface (API) may make changes upon or after a ticket is solved
This article provides a workaround to apply in these situations, with triggers that automatically close tickets based on certain conditions. For example, you can use the presence of a particular custom field value or a specific tag. The workflow includes the steps below.

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';
}
});
});
Step 1: Create a trigger
To create the trigger:

Click the product name, such as Support or Knowledge, from the menu in the top left corner > Admin Center

Click Objects and rules in the sidebar > Business rules > Triggers

Click Create trigger

Enter a Name and a Trigger category

Under Meet ALL of the following conditions, add Object > Ticket > Status category | Less than | Closed and Object > Ticket > Tags | Contains at least one of the following | closenow

Under Actions, add Object > Ticket > Remove tag | closenow and Object > Ticket > Status category | Closed. This order of actions prevents issues with follow-up tickets that automatically close upon creation.
Click Create trigger



Step 2: Create a macro for your agents
To make sure that your agents don't forget to add the closenow tag, add a macro.
To add a tag with a macro:

Click the product name, such as Support or Knowledge, from the menu in the top left corner > Admin Center

Click Workspaces in the sidebar > Agent tools > Macros > Create macro

Enter a Macro name

From Available for, select All agents

Under Actions, add Add tags | closenow

Click Create


Step 3: Ask an agent to refresh the page and use the macro
To apply that macro:

Ask an agent to refresh the page on Zendesk
Open a Support ticket to close, click Apply macro, then select the name of the macro you created
Click Submit as Solved


This applies the macro from a ticket. The ticket receives the tag automatically, which starts the trigger.
Note: In accounts with custom ticket statuses deactivated, use Status for the condition and action instead of Status category in the trigger recipe above.
