Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation to update custom date field from date string

Rupesh Panchal
December 1, 2025

Hello Community. 

I’m working on a Jira Automation rule in my Service Desk project.

Here’s what I’m trying to do:

  • I extract a date string from an issue description field and store it in a variable.  Example date string in description field is: 'Start Date: Jan 5, 2026'

  • 1st action is create a variable called rawStartDate and use this smart value: {{issue.description.match(".*Start Date: (.+).*")}}
  • The value of rawStartDate is in the format Jan 5, 2026 - which is great!

  • I want to convert this value to a date object and then format it as MM/dd/yyyy (e.g., 01/05/2026) using Jira Automation smart values.

  • I’m using the smart value:
    {{rawStartDate.toDate.format("MM/dd/yyyy")}}

  • However, when I log either {{rawStartDate.toDate}} or {{rawStartDate.toDate.format("MM/dd/yyyy")}}, the output is blank. I also tried MM-dd-yyyy.

  • Logging {{rawStartDate}} shows the correct value (Jan 5, 2026), so the variable is being set.

  • Final step would be to edit the custom work item field with this date object.

What am I missing, or is there a known issue with .toDate and this date format in Jira Automation? Any suggestions for troubleshooting or workarounds would be appreciated!


 

2 answers

1 accepted

5 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 1, 2025

Hi @Rupesh Panchal -- Welcome to the Atlassian Community!

First thing: how is the date getting into the Description field?

If a person is typing it in, the format may be difficult to predict...and thus asking people to select a value with a date-picker custom field may be better than using text.

 

If instead the date is populated in the Description by a system, rule, etc., please note you are using an alphanumeric format for the date as text.  Thus, you need to supply a matching format for the toDate() function:

https://support.atlassian.com/cloud-automation/docs/examples-of-using-smart-values-with-dates/#Converting-text-to-dates

Perhaps try this:

{{rawStartDate.toDate("MMM d, yyyy")}}

 

Kind regards,
Bill

Rupesh Panchal
December 1, 2025

@Bill Sheboy This worked and thanks for the explaination. 

To answer your question the date is being populated by another system via email.  The format is consistent. 

Apprciate the help!

Like Bill Sheboy likes this
1 vote
Rupesh Panchal
December 1, 2025

Here is picture of the automation:

image.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events