Zendesk

How to Automatically Create Expiration Dates Based on a Start Date in Zendesk

Learn how to automatically generate expiration dates from start dates in Zendesk using triggers, webhooks, and Liquid markup. Step-by-step guide with real examples for warranty tracking, SLA management, and more.

calender-image
November 4, 2025
clock-image
12 minutes

The Challenge: Zendesk Doesn't Calculate Dates Automatically

You've got a start date in a custom field. Maybe it's when a customer's trial began, when their warranty activated, or when a contract was signed. Now you need to automatically set an expiration date—say, 30 days, 90 days, or a year from that start date.

The problem? Zendesk doesn't have native field calculation capabilities. You can't simply tell a date field to equal "another date field + 30 days" the way you might in a spreadsheet.

This creates a real workflow challenge. Without automatic expiration dates, you're left manually calculating and entering dates, which is time-consuming, error-prone, and doesn't scale as your ticket volume grows.

But there's good news: you can automate this process using Zendesk's triggers, webhooks, and Liquid markup. Let's explore how.

Why You Need Automatic Expiration Dates

Before diving into the technical solutions, let's understand the common scenarios where automatic expiration date calculation becomes essential:

Warranty and Service Contract Tracking
When customers purchase products with warranties or service agreements, support teams need to track when coverage expires. Automatic expiration dates help you proactively reach out before warranties end, offering renewals and preventing gaps in coverage.

Trial Period Management
For SaaS companies or businesses offering trial periods, automatically calculating when trials expire helps you trigger follow-up workflows, send upgrade reminders, and manage the conversion process efficiently.

SLA and Response Time Management
Setting automatic deadline dates based on ticket creation helps teams stay on top of response time commitments and escalate issues before SLA breaches occur.

Subscription Renewal Tracking
For businesses managing recurring subscriptions through their support system, calculating renewal dates from signup dates ensures no customer falls through the cracks.

Compliance and Documentation Deadlines
Industries with regulatory requirements often need to track when documentation expires or when compliance reviews are due, making automatic date calculation a necessity.

Understanding Zendesk's Date Field Limitations

Zendesk doesn't offer calculated fields or business rule actions to perform field calculations natively. This means you can't use triggers alone to calculate a new date based on another date field through standard trigger actions.

However, custom date fields are available for use in triggers as conditions, which opens up possibilities when combined with other Zendesk features like webhooks and Liquid markup.

"The biggest limitation teams face is that Zendesk treats date fields as static values rather than formulas. But with the right workaround, you can build a system that feels just as automatic."

Solution 1: Simple Approach Using Trigger Date Actions

For straightforward scenarios where you need to set an expiration date a fixed number of days in the future from ticket creation, Zendesk's built-in trigger actions can work.

When This Works Best

  • You need to set a date relative to ticket creation (not a custom date field)
  • The number of days is always the same
  • You don't need complex date calculations

How to Set It Up

  1. Create Your Custom Date Fields
    • Go to Admin Center > Objects and rules > Tickets > Fields
    • Create a date field for your expiration date (e.g., "Warranty Expiration Date")
    • Note down the field ID
  2. Create the Trigger
    • Navigate to Admin Center > Objects and rules > Business Rules > Triggers
    • Create a new trigger
    • Set conditions (e.g., "Ticket is Created" and "Warranty Start Date is present")
    • In Actions, select your expiration date field
    • Choose "X days from now" (e.g., 30 days from now)

Limitations

This approach only works when calculating from the current date/time, not from another custom date field. If you need to calculate "30 days from warranty start date" where the warranty start date is a custom field the customer fills in, you'll need the advanced solution below.

Solution 2: Advanced Approach Using Webhooks and Liquid Markup

For more complex scenarios where you need to calculate an expiration date based on a custom start date field, you'll need to use webhooks combined with Liquid markup.

Understanding the Components

Webhooks allow Zendesk to make API calls back to itself to update ticket fields that normally can't be updated through standard triggers.

Liquid markup is a templating language that enables you to perform calculations and manipulate data within Zendesk.

Liquid allows you to create simple programming logic such as case statements, if statements, for loops, and customize how ticket data is selected and displayed.

Step-by-Step Implementation

Step 1: Enable API Access

Ensure you have enabled API access in your Zendesk account. You'll need this to authenticate your webhook.

  • Go to Admin Center > Apps and integrations > APIs > Zendesk API
  • Enable token access
  • Generate a new API token and save it securely

Step 2: Create Your Custom Date Fields

You'll need two date fields:

  1. Start Date Field - The field users will fill in (e.g., "Warranty Start Date")
  2. Expiration Date Field - The field that will be automatically calculated (e.g., "Warranty Expiration Date")

To create these:

  • Navigate to Admin Center > Objects and rules > Tickets > Fields
  • Click "Add field" and select "Date"
  • Name your fields appropriately
  • Note down both field IDs (you'll find these in the field details)

Step 3: Create the Webhook

  1. Go to Admin Center > Apps and integrations > Webhooks > Webhooks
  2. Click "Create webhook"
  3. Configure the webhook:
    • Name: Update Expiration Date
    • Endpoint URL: https://yoursubdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json
    • Request method: PUT
    • Request format: JSON
    • Authentication: Basic authentication
    • Username: youremail@company.com/token (note the /token suffix)
    • Password: Your API token from Step 1
  4. Click "Create webhook"

Step 4: Create the Trigger with Liquid Date Calculation

Now create a trigger that will fire the webhook and calculate the expiration date:

  1. Navigate to Admin Center > Objects and rules > Business Rules > Triggers
  2. Click "Add trigger"
  3. Name it something like "Calculate Warranty Expiration Date"

Conditions:

  • Ticket: Is Created (or Is Updated, depending on your needs)
  • Warranty Start Date: Is present
  • Tags: Does not contain expiration_calculated (to prevent infinite loops)

Actions:

  • Add tag: expiration_calculated
  • Notify active webhook: Select your "Update Expiration Date" webhook

JSON Body:

json

{
 "ticket": {
   "custom_fields": [
     {
       "id": YOUR_EXPIRATION_FIELD_ID,
       "value": "{{ ticket.ticket_field_YOUR_START_DATE_FIELD_ID | date: '%s' | plus: 2592000 | date: '%Y-%m-%d' }}"
     }
   ]
 }
}

Understanding the Liquid Calculation:

Let me break down what's happening in that Liquid code:

  • {{ ticket.ticket_field_YOUR_START_DATE_FIELD_ID }} - References your start date field
  • | date: '%s' - Converts the date to Unix timestamp (seconds since 1970)
  • | plus: 2592000 - Adds seconds (2,592,000 seconds = 30 days)
  • | date: '%Y-%m-%d' - Converts back to Zendesk's date format (YYYY-MM-DD)

To modify the date to be 30 days relative to the original date, you add the number of seconds required. Here are common time conversions:

  • 1 day = 86,400 seconds
  • 7 days = 604,800 seconds
  • 30 days = 2,592,000 seconds
  • 90 days = 7,776,000 seconds
  • 1 year (365 days) = 31,536,000 seconds

Step 5: Replace the Field IDs

In your JSON body, replace:

  • YOUR_EXPIRATION_FIELD_ID with your expiration date field's ID
  • YOUR_START_DATE_FIELD_ID with your start date field's ID

You can find these IDs by going to Admin Center > Objects and rules > Tickets > Fields, clicking on each field, and looking at the ID in the URL or field details.

Step 6: Test Your Setup

  1. Create a test ticket
  2. Fill in your start date field
  3. Wait a few seconds
  4. Reload the ticket
  5. Check if the expiration date field has been populated automatically

The Zendesk agent interface is not always updated immediately when a webhook fires, or sometimes the update is delayed. Reload the ticket if in doubt.

Troubleshooting Common Issues

Issue: The Expiration Date Field Isn't Being Updated

Check these things:

  1. Verify your field IDs are correct - The most common mistake is using the wrong field IDs
  2. Check webhook authentication - Make sure your email includes /token at the end
  3. Review the webhook activity log - Go to your webhook settings and check the invocation logs for errors
  4. Validate JSON syntax - Use a JSON validator to ensure your JSON body is properly formatted
  5. Check trigger conditions - Make sure the trigger conditions are being met

Issue: Webhook Fires Multiple Times

Add the tag condition Tags: Does not contain expiration_calculated and include the action Add tag: expiration_calculated to prevent the trigger from firing repeatedly on the same ticket.

Issue: Date Format Errors

Zendesk uses the format YYYY-MM-DD for date fields. Make sure your Liquid output uses '%Y-%m-%d' as the final date format.

Issue: Timezone Problems

Custom date fields used in business rules or views always reference GMT time and not the account timezone. Keep this in mind when calculating dates, especially for time-sensitive deadlines.

Related Use Cases and Variations

Setting Multiple Expiration Dates

You can update multiple date fields in a single webhook call:

json

{
 "ticket": {
   "custom_fields": [
     {
       "id": FIRST_FOLLOWUP_DATE_ID,
       "value": "{{ ticket.ticket_field_START_DATE_ID | date: '%s' | plus: 604800 | date: '%Y-%m-%d' }}"
     },
     {
       "id": SECOND_FOLLOWUP_DATE_ID,
       "value": "{{ ticket.ticket_field_START_DATE_ID | date: '%s' | plus: 1209600 | date: '%Y-%m-%d' }}"
     },
     {
       "id": FINAL_EXPIRATION_DATE_ID,
       "value": "{{ ticket.ticket_field_START_DATE_ID | date: '%s' | plus: 2592000 | date: '%Y-%m-%d' }}"
     }
   ]
 }
}

This sets follow-up dates at 7 days, 14 days, and 30 days from the start date.

Conditional Date Calculations

You can use Liquid's conditional logic to set different expiration periods based on other ticket fields:

json

{
 "ticket": {
   "custom_fields": [
     {
       "id": EXPIRATION_DATE_ID,
       "value": "{% if ticket.ticket_field_WARRANTY_TYPE == 'standard' %}{{ ticket.ticket_field_START_DATE | date: '%s' | plus: 2592000 | date: '%Y-%m-%d' }}{% elsif ticket.ticket_field_WARRANTY_TYPE == 'premium' %}{{ ticket.ticket_field_START_DATE | date: '%s' | plus: 7776000 | date: '%Y-%m-%d' }}{% endif %}"
     }
   ]
 }
}

This sets 30-day expiration for standard warranties and 90-day expiration for premium warranties.

Triggering Automations Based on Expiration Dates

Once you have automatic expiration dates set, you can create automations that trigger based on those dates:

The "Is within the next" condition evaluates based on an integer number of days, with each day translated into 24-hour multiples. For example:

  • 30 Days Before Expiration Reminder:
    • Condition: Warranty Expiration Date | Is within the next | 30
    • Action: Send email to customer about upcoming expiration
  • 7 Days Before Expiration Urgent Reminder:
    • Condition: Warranty Expiration Date | Is within the next | 7
    • Action: Send urgent email and assign to renewal team

Best Practices and Recommendations

1. Use Clear Naming Conventions

Name your fields clearly so agents understand what they're for:

  • "Warranty Start Date" vs "Start Date"
  • "Warranty Expiration Date" vs "End Date"

2. Make Start Dates Required When Appropriate

If expiration calculation is critical to your workflow, make the start date field required on relevant ticket forms to ensure the calculation always happens.

3. Document Your Calculations

Using webhooks this way is not officially supported by Zendesk for troubleshooting purposes, so maintain clear documentation of:

  • Which fields are calculated
  • The formulas being used
  • The expected behavior

4. Test Thoroughly Before Production

While this approach has been successfully implemented by Zendesk users, test it thoroughly in your sandbox or with test tickets before rolling it out to production.

5. Consider Using Views for Expiration Management

Create views that help you manage expiring items:

  • "Warranties Expiring This Month"
  • "Trials Ending This Week"
  • "Overdue Renewals"

6. Monitor Webhook Performance

Check the webhook activity logs regularly to ensure successful invocations and catch any errors early.

Alternative Approaches and Tools

While the webhook + Liquid approach is the most flexible native solution, here are alternatives to consider:

Third-Party Apps

Several Zendesk marketplace apps offer enhanced field calculation capabilities. These can be easier to set up but come with additional costs.

External Middleware

For complex scenarios, some teams use external services (like Zapier or custom middleware) to handle date calculations and update Zendesk via API.

Spreadsheet Integration

For smaller volumes, some teams use Google Sheets + API integration to manage calculations externally and sync back to Zendesk.

Important Limitations to Keep in Mind

While this solution works well for most use cases, there are some limitations:

  1. Webhook delays: Updates may take a few seconds to appear
  2. No business day calculations: The simple second-based calculation doesn't account for weekends or holidays
  3. Timezone considerations: Date calculations use GMT/UTC
  4. API rate limits: If you have very high ticket volumes, be mindful of API rate limits
  5. Troubleshooting support: Since this uses webhooks in a workaround manner, Zendesk support may have limited ability to help troubleshoot issues

Wrapping Up

Automatically calculating expiration dates in Zendesk might seem tricky at first, but with webhooks and Liquid markup, you can create a robust solution that saves time and reduces errors.

The key steps are:

  1. Create your start and expiration date custom fields
  2. Set up a webhook pointing back to your Zendesk API
  3. Build a trigger with Liquid date calculations in the JSON body
  4. Test thoroughly and monitor for issues

While Zendesk doesn't natively support field calculations, this workaround—discovered and refined by the Zendesk community—provides a powerful way to automate date-based workflows.

Note: This implementation approach is based on solutions shared by Zendesk users and administrators. While it's not officially documented in Zendesk's help center as a standard feature, it leverages Zendesk's API and webhook capabilities in a creative way that many teams have successfully implemented.

Need Help Implementing This?

If you're finding this implementation challenging or need help customizing it for your specific use case, consider reaching out to a Zendesk consultant or checking out the Zendesk community forums where administrators share their experiences and solutions.

Have questions about this setup? Drop them in the comments below, and we'll help you troubleshoot!

About Macha AI

Macha AI builds purpose-built AI apps for Zendesk — including Copilot, Auto Reply, and Translations — designed to help agents work faster and smarter. And this is just the beginning. Many more apps are on the way. Learn more → getmacha.com

Blog Image
Blog Image