How to list issues with no "timespent" changes in the last 7 days?

Anderson Sant'Anna December 9, 2024

Hi everyone,
I'm trying to create a JQL query to list issues that have not had any changes in the "timespent" field in the last 7 days.

The challenge is that the "timespent" field does not support the CHANGED function, making it difficult to track when it was last updated.

Does anyone know an alternative way to achieve this? Any workarounds or ideas would be greatly appreciated!

Thank you in advance!

3 answers

1 accepted

2 votes
Answer accepted
Anderson Sant'Anna December 13, 2024

Hi @Trudy Claspill , @Harshit Grover  and @Marc - Devoteam 

 Tracking changes to the "Time Spent" field in Jira can be tricky since the CHANGED function isn't supported. Here's how I solved it using Jira Automation and a custom field.


🛠️ Step 1: Create a Custom Field

  • Create a Date/Time field called "Last Timespent Update".
    This field will store the timestamp of the last update to the "Time Spent" field.

🛠️ Step 2: Automation Rule

  • Trigger: Use the Work Logged trigger.
  • Condition: Ensure {{worklog.timeSpent}} > 0.
  • Action: Edit Issue Field → Set "Last Timespent Update" to:
    {{now.convertToTimeZone(issue.reporter.timeZone)}}

This tracks when work is logged or edited, updating the custom field with the latest timestamp.


📅 JQL Query

To list issues with no "Time Spent" changes in the last 7 days, use:

"Last Timespent Update" <= -7d

This approach gives you a clear way to track changes to Time Spent. Let me know if you have any questions or ideas for improvement! 🚀

2 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2024

Hello @Anderson Sant_Anna 

Welcome to the Atlassian community.

It is not an exact match to your scenario but you could do this:

worklogDate < -7d and not worklogDate >=-7d

That would get you issues that have at least one Work Log entry older than 7 days but no Work Log entries in the past 7 days. To change Time Spent a user must make, edit, or delete a Work Log entry since the Time Spent field is not directly editable. This would only pick up Time Spent changes due to a Work Log entry being created.

0 votes
Harshit Grover
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.
December 9, 2024

Hi @Anderson Sant_Anna ,

 

The "timespent" field in Jira does indeed not support the CHANGED function, which limits tracking changes directly in JQL. However, you might be able to achieve this through a workaround :

Custom field and Automation : 

You can use Jira Automation to track updates to the timespent field by maintaining a custom field (Last Timespent Update) that captures the last updated timestamp whenever timespent changes.

Steps:

  1. Create a Custom Field:

    • Create a Date/Time custom field (e.g., Last Timespent Update).
  2. Set Up an Automation Rule:

    • Go to Jira Settings > Automation.
    • Create a rule with the following triggers and actions:
      • Trigger: Field value changed (select timespent).
      • Action: Edit issue field.
        • Set the Last Timespent Update field to {{now}}.
  3. JQL Query: Once this is set up, you can query issues where Last Timespent Update has not been updated in the last 7 days:

    "Last Timespent Update" <= -7d

    Regards, 
    Harshit
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2024

@Harshit Grover 

Time Spent is not available to be selected in the Field Value Changed trigger.

Instead I believe you would need to use the Work Logged trigger, since Time Spent can be changed only by the creation, editing, or deletion of a Work Log.

Or selecting the Time Tracking field for the Field Value Changed trigger might work.

Like Anderson Sant'Anna likes this
Anderson Sant'Anna December 11, 2024

Hi everyone,
I'm trying to create an automation rule to track changes to the Time Spent field. Based on suggestions from the community, I created a custom field (Last Timespent Update) and set up an automation rule.

Here’s what I did:
1️⃣ Created a Date/Time custom field called Last Timespent Update.
2️⃣ Set up an automation with the following:

  • Trigger: Field Value Changed (Time Tracking)
  • Action: Edit Issue Field (Set Last Timespent Update to {{now}})

The problem is that the automation only triggers when I change the Original Estimate field, but it does not trigger when I log work using the Time Tracking option. I also tried using the Work Logged trigger, but it didn't work as expected.

Has anyone faced this issue? How can I properly trigger the automation whenever the Time Spent changes?

Any guidance would be greatly appreciated!

Thanks in advance!

Marc - Devoteam
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.
December 13, 2024

Hi @Anderson Sant_Anna 

Good to see you fixed it.

@Trudy Claspill is also right.

But the other answer is an AI answer. Ai just combines information it knows based on other input it got.

It just puts the related field in place of another field based on same automation created answer.

Like Anderson Sant'Anna likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events