Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL statement to compare due date and start date

Simon Huprich
December 18, 2025

Hi,

I would like to do the following: 

Trigger:

  • If due date ist changed, but start date is not changed

Condition + action: 

  • If: if due date is the same as start date => edit custom field A in work item 
  • else: if due date is start date + 1 day => edit custom field B in work item
  • else: if due date is start date + 2 days => edit custom field C in work item

The "edit" part is just an example. The main question is how the if-else block should be created so that I can compare the due date and the start date. Because in the end I want to use the information how many days are in between due date and start date. 

What is the best way to accomplish that? 

Thanks a lot for any ideas!

Regards
Simon

 

 

 

2 answers

0 votes
Trudy Claspill
Community Champion
December 18, 2025

Hello @Simon Huprich 

How are you making changes to the fields? Are those changes being made inline in the Work Item View such that one field is changed and saved and then another field is changed and saved? Or do you use a workflow transition with a screen where you can choose to change one or the other or both?

Is the scenario to determine if both fields have been changed at the same time, or to find out when the Due date changes if there has ever been a change to Start date?

In what way is this rule not working for you? What is the output in the rule audit log when the rule executes?

A problem I see with your rule is that the trigger is monitoring only the Due date. Because of that the {{fieldChange}} smart value will contain information only about the change to the Due date field. So your condition to check the smart values of {{fieldChange.startdate.*}} are likely getting no values.

When I better understand your scenario I might be able to offer some advice.

Simon Huprich
December 18, 2025

Hi @Trudy Claspill 

  • The change of the due date should happen for example in the list view (inline - work item).
  • The start date should not change. Only the due date. 
  • The rule is not working because this condition is not working as aspected. 
  • The rules should only monitor the due date. The start date should not change.

Let me explain my idea in other terms: 

Trigger: the due date of an work item is changed manually in the LIST view.

Condition: After this change the automation rules should compare the start date (already exists as date in the work item) and the changed due date. This comparison can have different results. Start date and due date could have the same date. Or start date and due date could be different (+1 day, +2 days, +3 days, etc. up to +9 days). The rules should then recognize this number of days and should create an action.

Action 1: If start date is 01.01.2026 and due date ist 02.01.2026, then there are 2 days in difference. If the result is 2 days then a specific value should be added to another custom field of this work item  

From my perspective the Action is not the issue but the Condition could be. 

Thoughts? 
Thanks!


Trudy Claspill
Community Champion
December 18, 2025

Thank you for that additional information. 

First you should remove the Condition that you have added within the rule Trigger. That is meaningless. {{fieldChanged.startdate}} is not a valid smart value in this case.

Do you have something set up elsewhere to ensure that the Due date is never set earlier than the Start date? If not, what would you want to have happen in that case?

What would you want to have happen if the Due date has changed from having a value to having no value?

What would you want to have happen if the Start date has no value?

Some changes I would make to the rule are:

1. Add a condition after the trigger to confirm that the Due date field has a value.

2. Add a condition after the trigger to confirm that the Start date field has a value.

Screenshot 2025-12-18 at 11.50.20 AM.png

3. Add a Create Variable action and store the calculation of the difference between the dates in that variable and initialize it to 0 (no difference in dates)

Screenshot 2025-12-18 at 11.51.50 AM.png

4. Then I would set up an If/Else block to check if the dates are the same and set the same variable to 0 if so, otherwise set the variable to the difference between the dates.

Screenshot 2025-12-18 at 11.52.27 AM.png

5. Then I would set up an If/Else-if block to check the value of the variable and take the appropriate actions.

Screenshot 2025-12-18 at 11.56.07 AM.png

 

 

Side note:

You said:

If start date is 01.01.2026 and due date ist 02.01.2026, then there are 2 days in difference.

That is not correct. The difference between Jan. 1 and Feb. 1 is 31 days.

0 votes
Jack Brickey
Community Champion
December 18, 2025

Hi @Simon Huprich , based on what I read here I would start with something like this where you create and store the difference between your two dates and then use if/else clause to use actions.

IMG_6284.jpeg

Simon Huprich
December 18, 2025

Hi @Jack Brickey 
I already tried something similar, but it didn't work. 
I wanted to integrate the comparison directly into a condition.
Any thoughts?

 

Screenshot 2025-12-18 at 13.26.17.png

 

Screenshot 2025-12-18 at 13.28.46.png

Jack Brickey
Community Champion
December 18, 2025

You can certainly do it without the variable. I just find using variables to be cleaner. If I need to change the smartvalue it is a onetime change vs. changing each if/else. I do not grasp the condition in your trigger. I think @Trudy Claspill hit on that very issue. You need to pull that out and create any unique conditions immediately following the trigger before any if/else.

Suggest an answer

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

Atlassian Community Events