Uploaded image for project: 'Automation for Cloud'
  1. Automation for Cloud
  2. AUTO-1681

Time tracking field is displaying in weeks with wrong calculation

    • Minor
    • Jira Software, Jira Service Management

      Issue Summary

      An Automation rule is set up to update time tracking fields (Actual Start, Daily Time Spent, and Time Spent) using smart values. While the Daily Time Spent calculation and its absolute value appear to be correct, the Time tracking with Time Spent and Time Logged fields are being calculated incorrectly.

      Steps to Reproduce

      1. Create an automation rule in Jira to update time tracking fields (Actual Start, Daily Time Spent, and Time Spent):
      2. When rule is triggered
      3. Edit issue field: Work Paused to 
        {{now}}
        
      1. Refetch issue data
      2. Edit issue field: Daily Time Spent 
        {{issue.customfield_id_for_Actual_Start_field.diff(issue.customfield_id_for_Work_Paused_field}} 
      1. Log work: 
        {{issue.customfield_id_for_Actual_Start_field.diff(issue.customfield_id_for_Work_Paused_field).minutes.abs}} 
      1. Refetch issue data
      2. Add to audit log: only diff: 
        {{issue.customfield_id_for_Actual_Start_field.diff(issue.customfield_id_for_Work_Paused_field)}} 
      1. Add to audit log: diff with minutes.abs: 
        {{issue.customfield_id_for_Actual_Start_field.diff(issue.customfield_id_for_Work_Paused_field).minutes.abs}} 
      1. Add to audit log: Actual start custom field value: 
        {{issue.customfield_id_for_Actual_Start_field}} 
      1. Add to audit log: Work paused custom field value: 
        {{issue.Work paused custom field value: {{issue.customfield_id_for_Work_Paused_field}}}} 

      Retrieve field ids via: https://your-site.atlassian.net/rest/api/2/field and seach for the Actual Start and other fields (you might need to create similar custom fields to reproduce similar behaviour in case your project doesn't have them).

      Expected Results

      Given `Actual Start` date value was set to: Jan 05, 2025, 5:00 PM
      Given `Now` retrieved value was set to: Feb 12, 2025, 5:59 PM

      Log action only diff: 38 days 0 hours 59 minutes
      Log action diff with minutes.abs: 54779
      Log action Actual start custom field value: 2025-01-05T06:00:00.0+0000
      Log action Work paused custom field value: 2025-02-12T06:59:00.0+0000

      Time tracking should be set to: 38 days 0 hours 59 minutes.

      Actual Results

      Time tracking set to the Time Spent value was set to:

      22 weeks, 4 days, 59 minutes

      Possible Causes of the Behavior

      • 54779 minutes correctly maps to 38 days 0 hours 59 minutes. But when setting time tracking isn’t treating 54779 as a number of minutes. Perhaps it’s treating it like a Date object, or a Unix Timestamp object, or something else instead.
      • Jira Time Tracking fields may require a specific duration format and the plain numeric value 54779 could lead to incorrect interpretation.
      • Minutes Treated as Seconds or Another Unit: interpreting 54779 as seconds rather than minutes that could introduce a significant discrepancy in the logged time, potentially converting seconds into other units.
      • Time formatting

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            [AUTO-1681] Time tracking field is displaying in weeks with wrong calculation

            Greetings!

            The likely workaround is to supply the units of measure when logging work time, as is required when a person does this with the UX work logging feature.  And so this may be usage problem rather than a defect.

            Kind regards,
            Bill

            Bill Sheboy added a comment - Greetings! The likely workaround is to supply the units of measure when logging work time, as is required when a person does this with the UX work logging feature.  And so this may be usage problem rather than a defect. Kind regards, Bill

              Unassigned Unassigned
              ed928c352689 Rejaine Lima
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated: