Can I use a History search to find issues where the due date has been changed more than 2 days?

stephan_lewis
Contributor
February 7, 2025

I want to create an automation to alert me on a daily basis when the due dates on any issues in my project have been changed by more than 2 days.

I was hoping that I could use a History search.

If I can create a filter then I willl be able to create the automation.

I havn't had any success playing around with the History search - has anyone tried this?

3 answers

0 votes
Jamie Echlin _ScriptRunner - The Adaptavist Group_
Atlassian Partner
February 11, 2025

Responding specifically to your question about the JQL AI which gave you poor guidance...

This is the well-known problem of LLM hallucination. There is a version of this which runs as a DC plugin, and is able to validate and refine the query, but this is not widely available.

To attempt to answer your question. I don't think JQL is the right solution here. A better approach would be a post-function that sends a notification, or sets a custom field, if in that transition the due date had changed by 2 days or more.

0 votes
Petru Simion _Simitech Ltd__
Atlassian Partner
February 7, 2025

Hi @stephan_lewis ,

 

  • You could add an automation rule that uses a custom field to show the difference.

This solution has a limitation. It is going to work only from the time is implemented, leaving the rest of the issues without a value.

 

  • You could create a scripted field which  uses the REST api to make a call and find in the issue history changes for the field you are looking for, and extract the occurences where the value is greater than two days. Then you create a scheduled job to run on a daily basis and report the issues for which the scripted field has a certain value. 

 

You filter for Updted Field - Due Date.

You export your data as csv, import in Excel and use an Excel formula to depict only those rows where the difference between Value From and Value To is greater than or equal to two days.

 

imageedit_12_9361768912.gif

You can run a report daily and get your data.

 

Regards, 

 

Petru

stephan_lewis
Contributor
February 7, 2025

Hi Petru,

You just gave me an idea - In place of Excel I already have Smartsheet linked up with Jira. I could use my bi-directional Jira connecotr to keep my Smartsheet insync with Jira. Then I could add an extra column with a formula to keep track of changes.

Will have to go play,

 

Thank you,

Stephan

 

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.
February 7, 2025

Hi @stephan_lewis 

No, the JQL CHANGED operator cannot detect history changes for the Due Date field: https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#CHANGED

You could create an automation rule, triggered on a change to the field, which uses the {{changelog}} values for comparisons:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--changelog--

Kind regards,
Bill

stephan_lewis
Contributor
February 7, 2025

I read through the changelog documentation but couldn't find anything relating to a duedate field.

I was trying to use Scriptrunner but got an error message that it couldn't find the field originalduedate which is funny because their JQL AI was the one that suggested the field.

issueFunction in dateCompare("project = AODPM", "duedate >= originalduedate +2d")

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.
February 7, 2025

First thing, I personally recommend not using any bot guidance for Jira help (even the built-in one yet).  Each Jira version / site / project / issue type / workflow has too much context-specific information which is not available for the bot / guesser to use.  Perhaps the built-in one will get better over time.

 

What I was suggesting for using the changelog was something along these lines:

  • trigger: Field Value Changed for the Due Date
  • action: Log (to write this value to the audit log)
{{#changelog.duedate}}{{fromString.toDate.diff(toString.toDate).days}}{{/}}

This would be the difference in days for the Due Date value change.  More logic is needed to handle cases when the value was initially null, or is changed to null from a date.

 

Suggest an answer

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

Atlassian Community Events