Jira Smart function date to sync the date in Jira

Hey team I have a question in Jira when you enter a date as a date object which is classified as a smart function is there a script which allows to the pull the date from Jira to Zendesk. example:

Comment syncs fine, but the date format does not pull or show in JIRA, just shows blank, tried various scripts and cant to get it work, any help on this would be appreciated.

Syncing date fields between Jira and Zendesk can be tricky due to differences in how each platform handles date formats. Based on the Exalate documentation, here’s how you can reliably sync a date custom field from Jira to Zendesk using Script mode:

On the Jira side (Outgoing sync):

replica.customFields."My Date CF" = issue.customFields."My Date CF"

Replace "My Date CF" with the actual name of your date custom field.

On the Zendesk side (Incoming sync):
You’ll need to ensure that the date value from Jira is correctly mapped to the corresponding Zendesk field. The exact script depends on how your Zendesk custom field is set up, but the key is to use the .value property if available:

entity.custom_fields["your_zendesk_date_field_id"] = replica.customFields."My Date CF"?.value

Replace "your_zendesk_date_field_id" with the actual Zendesk custom field ID.

Important notes:

  • If the date still appears blank, double-check that the field names/IDs are correct on both sides.
  • Sometimes, you may need to format the date string to match Zendesk’s expected format. If so, you can use Groovy’s date formatting utilities in your incoming script.

For more details and advanced scenarios (like syncing between different platforms or handling time zones), check out the official documentation:

This approach should help you get the date field syncing properly. If you need to handle specific date formats or encounter errors, you may need to add some date parsing logic as shown in the documentation.

This is not a field this is done via comments in Jira.

Hi @Ellesh_Miyangar

Apologies for the delay in response.

We will update you for this shortly.

Thanks,

Sonal

Hi @Ellesh_Miyangar ,

Hope you are doing well.

I tested this locally and found that Exalate truncates the Date part when posting the comment on the Zendesk side.

To solve this I tried this script and it works for me. (It displays the date in the comment).

Can you replace this with the current script on the incoming side on Zendesk?

// --- normalize issue.comments so += never breaks ---
def asList = { v ->
  (v instanceof Collection) ? (v as List) : (v ? [v] : [])
}

// Convert {{YYYY-MM-DD}} -> YYYY-MM-DD (so Zendesk won't strip it)
def stripCurlyDate = { String s ->
  if (!s) return s
  // Replace ANY {{something}} with just something, but especially dates
  // Example: "test date {{2026-02-26}}" -> "test date 2026-02-26"
  s.replaceAll(/\{\{([^}]+)\}\}/, '$1')
}

// Ensure issue.comments is a list
issue.comments = asList(issue.comments)

// Take only newly added comments and rewrite body
def added = asList(replica.addedComments).collect { c ->
  if (c instanceof Map) {
    c.body = stripCurlyDate(c.body as String)
    return c
  } else {
    c.body = stripCurlyDate(c?.body as String)
    return c
  }
}

// Append
issue.comments = issue.comments + added

Let me know how it goes.

Thanks, Dhiren