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'
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.
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!
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:
Perhaps try this:
{{rawStartDate.toDate("MMM d, yyyy")}}
Kind regards,
Bill
@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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.