Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Copy date field content to a datetime field without loosing the time

Rudy Holtkamp
Community Champion
September 6, 2023

Hi all,

I'm trying to build an automation which copies the time from a date field (Start Time) to a datetime field (Start Time [Gantt]).

When I do this the easy way, it will remove the time set in the datetime field and the requirement is to keep the time.

I can extract the time before making the change and put them into variables, called hours & minutes. But I can't add them to the datetime field.

I've an Edit issue component with Start Date [Gantt] (the datetime field) and the following smart value:

{{issue.Start Date [Gantt].withHour(hours)}}

I also tried

{{issue.Start Date [Gantt].withHour({{hours}})}}

But I keep getting the error:

Error rendering smart-values when executing this rule:
Failed to get value for issue.Start Date [Gantt].withHour({{hours: {{issue.Start Date [Gantt].withHour({{hours}})}}
So how can I keep the time?

1 answer

0 votes
David Leal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2023

withHour is expecting a number, did you check your {{hours}} variable stores a number? (for example isNumeric()) Please share your automation rule. Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events