You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.
Join groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
I'm using Jira automation.
The incoming JSON on a webhook has "2021-11-23 23:45" in it.
I'd like to splat it into a customfield as a DateTime
So far, my attempts have yielded either a action failure or no data.
Best-guess I have is this, but that results in an empty field...
{{webhookData."Date and Time of Incident".toDateTime("yyyy-MM-dd HH:mm")}}
Hi @Sam Lander
Try ".toDateTime.as("yyyy-MM-dd HH:mm")
Try first to print it to the automation log, see if you get the result you want, then try to set it to a field.
Note that in order to set it to a field the format must be exactly as your dateTime customfields look like, make sure if you need use "-" or "/"
Thanks for the suggestion @Nir Haimov
I get
Error creating issueError parsing time: 2021-04-12 14:23.toDateTime.as("yyyy-MM-dd HH:mm")}} (customfield_10032)
or
Error creating issueError parsing time: 2021-04-12 14:23.toDateTime("yyyy-MM-dd HH:mm")}} (customfield_10032)
using either method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sam Lander can you send screenshot of the automation, so we can see exactly how look what you wrote?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for pointing out the "Log Action", that made my life eeasier.
Screenshot:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No problem :)
According to the documentations,
The following functions can be used to convert a date to a date with a time component:
{{now.toStartOfDay}}
{{now.toCurrentTime}}
{{now.toDateTimeAtStartOfDay}}
{{now.toDateTimeAtStartOfDay(timezone)}}
{{now.toDateTimeAtCurrentTime}}
{{now.toDateTimeAtCurrentTime(timezone)}}
Please try them out let me know if one of them works for you, if not, send screenshot with them too :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think that this is the only possible answer. It is not so clean, because it implies stripping out the time with string ops, then adding it back into the DateTime created by blah.toDateTimeAtStartOfDay - I was hoping for something cleaner ....
I have implemented a workaround (a text field called "user-reported Time of Incident") instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Calling all Confluence Cloud Admins! We created a new Community Group to support your unique needs as Confluence admins. This is a group where you can ask questions, access resou...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.