Hi there,
For reasons that predate my involvement, there is a single select field that exists in our instance that consists of a bunch of times, eg "3:00 PM"
I'd like to backfill via an A4J rule to combine these with an existing date field into a new single Date/Time Field but am having difficulty getting the values of both of these fields into something that Jira will accept as a valid entry for a date/time field.
Any advice?
Without seeing the specifics of your rule for context...
There are several ways to do this using date / time functions:
Kind regards,
Bill
How my rule is currently:
- Take {{issue.Time Field.value}} as a variable {{TimeToString}}, logs correctly as "11:30 PM"
- Take Date as {{issue.Date Field.JiraDate}} as a variable {{DateToString}}, logs as 2025-08-25
When I try to put them together I have them going into the Date/Time Field as {{DateToString}}{{TimeToString}}
What's the context for the toDate() function given the above?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the documentation for that function:
You may try letting the rule "guess" the format with just toDate() or to specify it exactly, such as with:
{{varSomeVariable.toDate("yyyy-MM-dd hh:mm a")}}
Please see the date / time format function to learn more about possible formats to supply based on the Java documentation:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-format---
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Amazingly letting it "Guess" ended up working better than trying to strictly parse it out before sending everything into the field, thanks!
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.