Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello,
Using Automation for Jira I am simply adding some comments to the ticket using SmartValues.
The field in question is 'Target start' (custom field from advanced roadmaps)
The field itself displays on the issues as:
However when I put it into the automation:
'This work has been scheduled to commence on {{Target start}}'
It comes out as:
Any idea how i can change the format into DD-MM-YYYY ?
Many Thanks
Phil
Hi @PhilSpo ,
I use this: {{issue.customfield_16705.longDate}}
But it can also be written:
{{issue.Target start.longDate}}
That will give you a result of October 17, 2020.
Hello John,
Cheers for the suggestion.
I have the automation setup as follows:
But if I use that format or {{issue.customfield_xxxxx.longDate}} it keeps coming out as :
It just ignores the Target start field completely, unless I add it in as {{Target start}} which then displays as 2020-10-17
Im stumped!!
Cheers
Phil
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.
@PhilSpo also looks like there is this format:
{{issue.resolutiondate.asLongDateTime}}
You might drive the as in front of LongDate.
Also see Andreas's suggestion below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @PhilSpo - try this one:
{{issue.Target start.toDate.shortDate.format("dd/mm/yy")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @John Funk
Unfortunately this hasn't worked either. It just returns no data.
Seems that this field isnt a date picker, but you can convert it to a date but not change the format.
Thanks for your suggestions in trying to help with this. Its much appreciated.
Cheers
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have a look at this documentation - smart-values-date-and-time-functions . Focus on the
{{[date].[dateformat]}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jack Brickey
I did take a look at this page before I posted, it seems everything I try doesn't bring back any values at all.
Cheers
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the problem is going to be that the field is not a 'Date Picker' type of field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have not played with it myself. I did find this thread that seems to indicate the need of the “#” - Format-Custom-Field-Date
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmmm, could be. But it is a date field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jack,
If this is not a date field, but looks like a date field, then you'll have to parse it into a date first. You can do this with our `toDate` function. See "Converting text to dates" on https://confluence.atlassian.com/automation/working-with-dates-993924630.html
Something like {{issue.Target start.toDate.shortDate}} should work!
Cheers,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
Thanks you for your responses in trying to help overcome this situation.
@John Funk i tried using the 'asLongDateTime' but unfortunately it returns no values and is blank.
@Andreas Knecht First of all I tried {{issue.Target start.toDate.shortDate}} but this returned 10/23/20
So then i combined that with the suggestion of John and used {{issue.Target start.toDate.longDate}}
This came back with October 23, 2020
This is a bit better for UK customers to understand but I'm still looking for that elusive dd/mm/yy format.
Using any of the below combinations produces no values.
{{issue.Target start.toDate("yyyy MM dd")}}
{{issue.Target start.toDate("dd MM yyyy")}}
{{issue.Target start.toDate("dd MM yy")}}
Cheers
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think these last ones are close but failing without the slashes.
If {{issue.Target start.toDate.shortDate}} successfully produces a date, the formatting piece for day-month-year would be:
{{issue.Target start.toDate.format("dd/MM/yy")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.