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 

2 answers

1 accepted

4 votes
Answer accepted
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}}.

Utsav Kothari
June 22, 2026

perfect, this works well now. thanks a lot for the quick responses! :D

Arkadiusz Wroblewski
Community Champion
June 22, 2026

@Utsav Kothari 

Nothing to thanks :)

We are here to Help each other.

Have great start Week 🤠

Like Utsav Kothari likes this
0 votes
Fatma Uzundemir from The Starware
Atlassian Partner
June 23, 2026

Hi @Utsav Kothari 👋🏻

While Jira natively supports tracking duration based on start and end dates, the built-in process is quite complex, which is exactly why our app offers a much more seamless and intuitive solution.

If you’re open to using a 3rd-party app to solve this seamlessly without losing precision, I can recommend ChronoFlow - Wait Time Analysis for Jira for this exact use case.

detail-1.png

With ChronoFlow, you don't need any complex automation scripts or code manipulation. It handles the precision and business calendars out of the box:

🌱 Accurate Time Calculation

ChronoFlow can calculate the exact duration between your Start Date & Time and End Date & Time fields based on your configured business calendar.

🌱 Working Hours & Holiday Support

You can define your company’s working hours, weekends, and holidays. The calculation automatically excludes non-working time.

🌱 Time to Resolution & Time in Status

Track how long issues take to complete, or analyze how much working time is spent in each status (Open, In Progress, Waiting, etc.).

🌱 JQL-Based Reporting

Filter issues using JQL and analyze durations by project, priority, component, assignee, or any other criteria.

Regarding your automation error: Jira’s native Time Spent field is tied to worklogs and cannot be directly updated through Automation. Instead of trying to overwrite this field, ChronoFlow calculates the required duration from your date fields without requiring custom scripts or complex rules.

header-1.pngdetail-5.png

You can explore the app here: ChronoFlow - Wait Time Analysis for Jira

🍀 Feel free to reach out if you have any questions!

Disclaimer: I work for the vendor who developed this application.

Suggest an answer

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

Atlassian Community Events