Retrieving Issues who's Due date have changed

C-Ramon_Alicea March 27, 2024

Good day,

Seeking assistance from some knowledgeable individuals and seeing if it’s even possible using JQL with ScriptRunner to see when issues Expected Completion Date (A Custom Field which stands for the Due Date in my project) has changed more or less than 7 days from the Expected Completion Date that the issue originally had showing.

Example:

Expected Completion Date: April 14, 2024

User updates the Expected Completion Date

New Expected Completion Date: March 31, 2024

 

Thank you in advance,

Ramon

2 answers

1 vote
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 28, 2024

Hi @C-Ramon_Alicea

From your description, it appears you want to compare the latest value added to a Custom Field against the previous value added to that same field. If yes, JQL is not going to correct approach.

Instead, you will need to use maybe ScriptRunner's Console and use the ChangeHistoryManager object to compare the differences in the values.

Alternatively, if you still intend to use only JQL, then the better approach would be to use two separate fields to compare the dates.

Please let me know so I can prepare an example.

Thank you and Kind regards,
Ram

C-Ramon_Alicea March 28, 2024

Good day Rama,

With the company I support and their strict implementation of JIRA, the only method I have to attempt this ask is using JQL with ScriptRunner.

Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 30, 2024

Hi @C-Ramon_Alicea

Unfortunately, you won't be able to do this via JQL. To compare the differences within the same field, the change history must be accessible.

JQL can only get the value changes for System Fields, i.e. Assignee, Fix Version, Priority, Reporter, Resolution, and Status. It's not doable for custom fields.

Please refer to this Atlassian Article for more information.

As mentioned in my previous comment, I suggest looking into the Change History using the ScriptRunner console.

I hope this helps to answer your question. :-)

Thank you and Kind regards,

Ram

0 votes
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 31, 2024

Hi @C-Ramon_Alicea 

You could possibly use Automation for this, with two additional custom fields?

It does depend on the parameters - my example below assumes the original date is the only important one. But you could do something like...

  • Create two custom fields - Original Expected Completion Date (Date Picker), and Date Moved >7 Days (Checkboxes, with one option - Yes)
  • Use Automation to...
    • Populate the "Original" field when the Expectation Completion Date is entered for the first time
    • Check each time the Expected Completion Date is modified, and check Date Moved if it's more than 7 days

You could then use the Date Moved field in your JQL.

---

You might not even need "Date Moved" with Scriptrunner JQL functions - you might be able to use dateCompare with 2 date fields instead.

Ste

 

Suggest an answer

Log in or Sign up to answer