Is there automation rule to check if a specified filed has been updated in X time?

Mathieu Fairfield June 17, 2024

I was going through the Automation rules possibilities to see if it was possible to apply a rule on an Issue depending on a field last update date, it doesn't seem to be available. 

Anyone here has applied something similar in their rules?

Thanks

1 answer

0 votes
Bill Sheboy
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.
June 17, 2024

Hi @Mathieu Fairfield -- Welcome to the Atlassian Community!

Short answer: that may only be partially possible.  I recommend describing what problem you are trying to solve (i.e., the "why do this") to help the community offer better suggestions.

 

Until we learn that...

There are some fields which work with the JQL CHANGED operator: https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#CHANGED  With that, a Scheduled Trigger rule could use JQL to test if something has changed / or not within a window of time.  For example, checking if the Status has not changed for several days.  But again that operator only works with a few fields.

 

The Field Value Changed trigger handles events for changes to a field.  And so a rule could be created which saves the date / time of an update in a separate custom field, and then that could be checked separately with JQL, essentially doing what CHANGED does.

A brute force way to do this without the extra custom field is to call the REST API to get the issue's changelog, read / parse the issue changes, and then decide how to proceed.  This may not work due to several possible rule limitations.

 

However...apparently not all field changes raise events for changes that can be detected by rules, and so those could not be detected with rules.  Workarounds for those might be to try site webhooks.

 

Kind regards,
Bill

Mathieu Fairfield June 17, 2024

Hey Bill! 

Here is the use case! 

I have automated tests on a software and whenever a crash is encountered, it searches my jira DB for the callstack. If it's found, it updates a custom field "Occurences" with +1 on the value. 

I would have used the last update date on the field to automatically close the issue after a week or 2.

I hoped something similar to"updatedDate" could be used on a field ID... 

Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 18, 2024

Like Bill suggested, introduce a date-time type custom field "Foobar" that stores the last update timestamp of the "Occurrences" field. Every time when you update "Occurrences", also update "Foobar" to the current date!

You can then use "Foobar" like any other field in JQL, using date-time arithmetics.

That's it.

Mathieu Fairfield June 18, 2024

In this case, Changed can't be used. I suppose i'll have to script it and poke the api. 

Like Aron Gombas _Midori_ likes this
Bill Sheboy
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.
June 18, 2024

Although the CHANGED operator cannot be used for other fields, if you have saved a date / time custom field when the field changes, JQL may still be used.

For example...

project = myProjectName
AND myCustomFieldLastUpdated > startOfDay() 

Where myCustomFieldLastUpdated is the date / time value refreshed by that other rule I described.

Like Mathieu Fairfield likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events