Explore recipe: How to capture the date when a macro is applied to a ticket

<div class="body">
<div class="article-banners">
<div id="docs-wmp-link">
<a href="https://support.zendesk.com/hc/en-us/articles/5411234991258-plan" rel="noopener" target="_blank">What's my plan?</a>
</div>
<div class="article-banner" id="suite_pee">
<table style="margin-left: 0px; margin-right: auto;">
<tbody>
<tr>
<td>
<strong>All Suites</strong>
</td>
<td>Professional, Enterprise, or Enterprise Plus</td>
</tr>
</tbody>
</table>
</div>
<div class="article-banner" id="support_with_explore_pe">
<table style="margin-left: 0px; margin-right: auto;">
<tbody>
<tr>
<td>
<strong>Support with</strong>
</td>
<td>Explore Professional or Enterprise</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>
In this Explore recipe, you'll discover how to generate a report that tracks
the instances when a macro is utilized by an agent.
</p>
<p>
There is no built-in method to report on macro activity, such as when a macro
is applied to a ticket. The system does not track macro usage by timestamp or
support reporting through tags added by macros.
</p>
<p>
To track macro usage, you can create a custom checkbox ticket field and add it
to the macro. Update the macro to check the box. This allows you to use the field
change to identify when the macro was applied.
</p>
<p>For more information see the articles:</p>
<ul>
<li>
<a href="https://support.zendesk.com/hc/en-us/articles/4408883152794-Adding-custom-ticket-fields-to-your-tickets-and-forms#topic_ubz_ynk_xj" rel="noopener noreferrer" target="_blank">Creating custom ticket fields </a>
</li>
<li>
<a href="https://support.zendesk.com/hc/en-us/articles/7410837495066-How-can-I-use-macros-to-add-tags-on-a-ticket" rel="noopener noreferrer" target="_blank">How can I use macros to add tags on a ticket </a>
</li>
</ul>
<p>Below is an example macro with the checkbox added.</p>
<figure class="wysiwyg-image">
<img alt="" height="776" src="https://support.zendesk.com/hc/article_attachments/9550451583002" style="aspect-ratio: 853/776;" width="853">
</figure>
<div class="p">
<div class="note">
<span class="notetitle">Note:</span> (Enterprise only) If you have multiple
ticket forms,
<a href="https://support.zendesk.com/hc/en-us/articles/5494868102426#topic_c5x_l3b_lk" rel="noopener noreferrer" target="_blank">edit the ticket forms</a>
where you want the field to appear, drag the field from the right onto the
ticket form, then click Save. Repeat for additional ticket forms.
</div>
<p>
<strong>Skill level</strong>: Average
</p>
<p>
<strong>Time required</strong>: 20 minutes
</p>
<ul>
<li>Zendesk Explore Professional or Enterprise</li>
<li>
Editor or Admin permissions (see
<a href="https://support.zendesk.com/hc/en-us/articles/4408836002970-Giving-users-access-to-Explore" rel="noopener noreferrer" target="_blank">Giving users access to Explore</a>)
</li>
<li>Ticket data in Zendesk Support</li>
</ul>
<h2 id="Building">Creating the report</h2>
<p>Use the following steps to create this report in Explore.</p>
<p>
<strong>To create the custom calculated attributes</strong>
</p>
<ol>
<li>
In Explore, click the reports (<img alt="" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/Explore_query_icon.png" style="height: auto;" width="16">)
icon.
</li>
<li>
In the Reports library, click <strong>New report</strong>.
</li>
<li>
On the <strong>Select a dataset</strong> page, click
<strong>Support</strong> &gt; <strong>Support - Updates history</strong>,
then click <strong>Start report</strong>. The report builder opens.
</li>
<li>
Next, you'll create a standard calculated attribute that records changes
to your custom checkbox. From the <strong>Calculations</strong> menu
(<img alt="" height="18" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/Explore_calculations.png" style="height: auto;" width="14">),
click <strong>Standard calculated attribute</strong>.
</li>
<li>
<p>
On the <strong>Standard calculated attribute</strong> page, enter
a name for your attribute like <strong>Macro Usage Date</strong>,
then enter or paste the following formula:
</p>
<pre>IF ([Changes - Field name]="Macro used")
AND (([Changes - Previous value]="0")
OR ([Changes - Previous value]=NULL))
AND ([Changes - New value]="1")
THEN [Update - Date]
ENDIF</pre>
<p>
Replace "Macro used" in the first line of the formula with the name
of your custom checkbox.
</p>
<p>
Optionally, you can use the [Update - Timestamp] instead to capture
the timestamp.
</p>
</li>
<li>
When you're finished, click <strong>Save</strong>.
</li>
<li>
Create another standard calculated attribute to list the name of the
macros. In the <strong>Calculations</strong> menu (<img alt="" height="18" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/Explore_calculations.png" style="height: auto;" width="14">),
click <strong>Standard calculated attribute</strong>.
</li>
<li>
On the <strong>Standard calculated attribute</strong> page, Under
<strong>Functions</strong>, click <strong>Add</strong>.
</li>
<li>
<p>
Search the <strong>SWITCH</strong> function and click <strong>+</strong>.
</p>
<figure class="wysiwyg-image">
<img alt="Switch function.png" height="372" src="https://support.zendesk.com/hc/article_attachments/9495178368794" style="aspect-ratio: 1206/372;" width="1206">
</figure>
</li>
<li>
Give the attribute name like <strong>Macro name</strong>.
</li>
<li>
Select the attribute containing the values you want see in the list or
the attribute name. In this case we use the <strong>Ticket tags</strong>
attribute.
</li>
<li>
In <strong>CASE _value1</strong>, enter the <strong>tag</strong> of the
macro.
</li>
<li>
In <strong>_return_value</strong>, enter the <strong>name</strong> of
the macro.
</li>
<li>
<p>
Enter your other cases for more macro you used, you will need to
manually type out additional CASE expressions. The formula for this
example looks like below:
</p>
<pre>SWITCH ([Ticket tags]) {
CASE "greetings_macro": "Greeting"
CASE "closing_ticket": "Closing Ticket"
CASE "closing_tickets": "Closing Ageing Tickets"
}</pre>
</li>
<li>
When you're finished, click <strong>Save</strong>.
</li>
</ol>
<p>
<strong>To create the report</strong>
</p>
<ol id="topic_ejl_ghv_pkb__ol_fft_t3v_pkb">
<li>
In the <strong>Metrics</strong> panel, click <strong>Add</strong>.
</li>
<li>
From the list of metrics, choose <strong>Updates</strong> &gt;
<strong>Agent updates</strong>, then click <strong>Apply</strong>. Ensure
that the metric aggregator is set to <strong>D_COUNT</strong>.
</li>
<li>
In the <strong>Filters</strong> panel, add the
<strong>Updater role</strong> attribute and configure it to show
<strong>Agents</strong> and <strong>Admins</strong>.
</li>
<li>
In the <strong>Rows</strong> panel, click <strong>Add</strong>.
</li>
<li>
From the list of attributes, choose <strong>Calculated attributes</strong>
&gt; <strong>Macro Usage Date</strong>, click <strong>Excluded</strong>
and select <strong>NULL</strong> then <strong>Apply</strong>.
</li>
<li>
Go back to <strong>Rows</strong> panel, click <strong>Add</strong>. From
the list of attributes, choose <strong>Calculated attributes</strong>
&gt; <strong>Macro name</strong> then <strong>Apply</strong>.
</li>
<li>
You can also add <strong>Ticket ID</strong> in <strong>Rows</strong>.
From the list of attributes, search <strong>Ticket ID</strong> &gt;
<strong>Apply</strong>.
</li>
<li>
The report should match the following:
<img alt="Macro Usage Date Report.png" height="1014" src="https://support.zendesk.com/hc/article_attachments/9495178368922" width="1344">
</li>
</ol>
</div>
<p>
</p>
</div><script id="docs-schema-markup" type="application/ld+json">{
"@context": "https://schema.org",
"@type": "TechArticle",
"@id": "https://support.zendesk.com/hc/en-us/articles/9495178369690",
"url": "https://support.zendesk.com/hc/en-us/articles/9495178369690-Explore-recipe-How-to-capture-the-date-when-a-macro-is-applied-to-a-ticket",
"headline": "Explore recipe: How to capture the date when a macro is applied to a ticket",
"description": "You can track when a macro is applied to a ticket by creating a custom checkbox field updated by the macro and then generating a report using calculated attributes to capture the date and name of the macro usage.",
"articleSection": "Ticket reporting recipes",
"datePublished": "2025-07-17T15:03:29+00:00",
"dateModified": "2025-09-06T00:03:06+00:00",
"inLanguage": "en-US",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://support.zendesk.com/hc/en-us/articles/9495178369690"
},
"author": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"publisher": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"isPartOf": {
"@type": "WebSite",
"name": "Zendesk Help",
"@id": "https://support.zendesk.com/hc/"
},
"about": {
"@type": "SoftwareApplication",
"name": "Zendesk",
"@id": "https://www.zendesk.com",
"softwareAddOn": {
"@type": "SoftwareApplication",
"name": "Explore",
"@id": "https://support.zendesk.com/hc/en-us/sections/4405298856346"
}
}
}</script>