Insert Date in Macro | The place for Zendesk users to come together and share
Skip to main content
September 20, 2016
Question

Insert Date in Macro

  • September 20, 2016
  • 24 replies
  • 77 views

We have a Macro with a comment and we would like to include today's date in the Macro. Is there a placeholder for today's date that we can use?

For example, the Comment reads:

We have referred this to our tech support team on {today's date} and they typically respond to clients in 1-2 hours.

This topic has been closed for replies.

24 replies

Dennis34
Employee
June 7, 2018

Considering the suggestions that Carsten and Joel have provided here where you are manually calculating a UTC offset, I would suggest creating two version of the macro - one where the offset includes daylight savings time, and one where it doesn't. Then, your team would simply need to select the appropriate macro based on the time of year. It's not perfect because there is a chance that your agents might accidentally choose the wrong macro version, but the risk should be fairly small.

I have no idea exactly how this could work, but the only alternative I can think of would be to create an app and upload it to Zendesk, and have the app systematically determine the right time based on the timezone you are in at the time you request the ticket update. Though an app could possibly lower the odds of the wrong time going out from accidental macro selection, there would be more up-front time/resources invested in the app creation and ongoing maintenance. 

Tiffany20
November 15, 2018

Hello,

I really like this insert date function.

 

I have a question for you regarding adding a FUTURE date. We have a 30 day free trial of our software and I've used the string to achieve the start date (today's date) but how would I adjust the string to capture 30 days from today's date?

ZZ59
November 15, 2018

Tiffany

I was able to generate a future date on this thread.

That same logic should work for you.

January 10, 2019

We have a custom date field on our Organization Object

I can get this to populate with a macro using the field placeholder - {{ticket.organization.custom_fields.last_upgrade}}

However the output format includes the Date and Time - e.g. 2018-12-09 00:00:00 +0000

Is there a way to format this to just output the date?

ZZ59
January 14, 2019

Jeff

You can control the format of the date like this:

{{ticket.organization.custom_fields.last_upgrade | date: "%-d %B %Y" }}

.. to give: 14 January 2019

You can find the formatting codes here.

January 16, 2019

Graeme - THANKS!

February 11, 2019

Is it possible to echo the name of the current month in the user's language?

Brett Bowser
Community Manager
February 11, 2019

Hey Christian,

It looks like natively this isn't possible with the existing placeholders which I've linked for you. That being said, it looks like you may be able to accomplish this using liquid markup in your triggers. I was able to track down the following Support Tip: Reference the current timestamp in a ticket update which goes over referencing the current time stamp as you update the ticket using liquid markup in your notification triggers.

I've also attached our documentation for Using Liquid markup to support multiple languages in automations, macros, and triggers (Professional and Enterprise) that I hope you'll find useful as well.

The above should hopefully get you close to what you're trying to accomplish.

Cheers!

February 11, 2019

I've done it thanks to your hints. It's a beast of a string but it works.

excerpt for german:

{% assign mon = 'now' | date: "%B" %}{% case mon %}{% when 'January' %}**Januar**{% when 'February' %}**Februar** [...] {% else %}Monat{% endcase %} bla

It must be possible to use some more if/then/or to divide different user languages in only one dynamic content placeholder but I'm fine with it now. Thank you.

Brett Bowser
Community Manager
February 11, 2019

Thanks for sharing Christian and glad you were able to get this working :)