Hello,
We have data that is being sent to a Jira automation to create a ticket. One of the fields it sends is a date field formatted like "YYYY-MM-DD". We need to be able to manipulate that to use another format, such as the mediumDate format that is listed under date formats here:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
However, when I try to take a date in that format and manipulate it, it gets returned as a blank value. Here is an example from our sandbox where I store it as a variable then attempt to log the resulting value from the transform:
Are there certain formats it can't transform? Is there any workaround?
Hi @Ylan Muller ,
Just to clarify, you're sending info/data to Jira to create a new Jira ticket/issue? Or is it vice versa - trying to send data out of Jira to create a ticket in another system?
Anyhow, whenever a variable is created, the value within is created as a string/text. You would need to convert that value/text to date to use formatting options for dates.
Basically, something like the following might do the trick (you'll potentially need to adjust the format within toDate() function by your specific case).
Btw, here's a similar question thread: Help converting variable to date
Hope this helps.
Cheers,
Tom
Ah, that's what it is. I was thinking there was some type of string > date format problem, but couldn't find anything with my mediocre Google-fu. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do want to note that in my testing, setting the date format in parentheses actually messed up the transform - dates like 2024-12-11 would become Dec 21, 2023, things like that. Using only toDate, such as {{DateVariable.toDate.longDate}} worked better for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad you've managed to sort it out :)
Thanks for the update/info as well!
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.