Forums

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

Calculate & update time taken based on start & end date and time fields

Utsav Kothari
June 21, 2026

hi, in some critical cases we want to monitor the time taken to finish a task. the team has been asked to update the fields "Start date & time" and "End date & time". Is there any way the time taken (in hours) can be calculated and automatically updated in the field "Time tracking". if not in "Time tracking", which other field can be used to update the time taken from the difference between end date time & start date time. As of now I'm not getting the option to select the field "Time tracking", instead I have selected original estimate. but I want time "Time spent" in "Time tracking" field to be updated with the hours.

I tried setting up an automation, but getting the below error with it:

time tracking automation error.jpg

and this is the automation workflow. I have added the smart

time tracking automation workflow.jpg

value {{issue.customfield_10134.diff(issue.customfield_10133).hours}}h 

1 answer

0 votes
Arkadiusz Wroblewski
Community Champion
June 21, 2026

Hi @Utsav Kothari 

You mixing here a little concepts.

Time spent isn't updated with Edit work item. It comes from worklogs. Updating Original estimate only updates the planned estimate, not logged time.

skip "Original estimate" as it's only for planning.

To update native time spent: Use the Log work action (not Edit issue) with: {{issue.EndDate.diff(issue.StartDate).minutes.abs}}m.

Prevent double-logging by adding a condition if dates are edited later. For reporting only, calculate this into a custom Number field instead of creating worklogs. That's not really clean.

Best,

Arkadiusz 🤠 ☀️ 

Utsav Kothari
June 21, 2026

hi @Arkadiusz Wroblewski thank you for pointing this out. however, when I try to use the "Log work" action, I'm getting below config where it looks like it's asking for fixated values. do you have anything on this?

Log work .jpg

Arkadiusz Wroblewski
Community Champion
June 21, 2026

Time spent: {{issue.customfield_10134.diff(issue.customfield_10133).minutes.abs}}m

Date started: {{issue.customfield_10133.jiraDateTime}}

If the .jiraDateTime function doesn't validate in your specific automation action, just fall back to the raw field value {{issue.customfield_10133}}.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events