Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Compare two date fields and add a label (ontrack-offtrack)

Núria Rull Bassols
Contributor
May 30, 2024

Hi!

I hope you are well

I want to create a rule to track customer bugs.

We have a custom field that is called "target repair date" and I have an automation rule that updates the start and due date with the dates of the sprint.

I would like to set up two labels:

- Ontrack (duedate is less than "target repair date")

- Offtrack (duedate is greater than "target repair date")

I want to ensure that issues meeting their deadlines are appropriately tagged for easier tracking and management.

Now the label is added in all situations, I cannot add the ontrack and offtrack based on that comparison and I cannot find the rootcause. 

 

Thanks a lot for your support!

Screenshot 2024-05-30 at 18.08.28.png

3 answers

3 accepted

2 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2024

Hi @Núria Rull Bassols - You'll need to change the conditions to If/Else conditions.  As it stands now, it will pass/fail the first condition but never pass the second condition.  It should look something like this:

  • TRIGGER: Value changes for Due Date
  • IF CONDITION: Compare two values
    • Edit Issue (Labels)
  • ELSE CONDITION: Compare two values
    • Edit Issue (Labels)

Secondly, you mention that you have another rule that is setting the due date. This means that you also need to check the box on the Rule Details screen that enables other rules to trigger the new rule:

Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule.

Núria Rull Bassols
Contributor
May 31, 2024

Thanks a lot @Mark Segall  that worked! 

What if I want to add another label but only if the due date is -10d or 15d of the Target repair date? Should I create variables? 

 

This will be like: "at risk" issues

- Due date is -10d or 15d of Target Repair date

 

Thanks

Screenshot 2024-05-31 at 11.44.16.png

Núria Rull Bassols
Contributor
May 31, 2024

I found the answer "minusDays." 

Thanks a lot; I hope that can help other people, too.

Screenshot 2024-05-31 at 14.15.02.png

Núria Rull Bassols
Contributor
May 31, 2024

Well @Mark Segall  I was too quick to "sing victory" I have issues with At Risk conditions

0 votes
Answer accepted
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2024

@Núria Rull Bassols -

I agreed with what @Mark Segall stated, especially his mentioning of "enables other rules to trigger the new rule:"

Here is a reference link on how to properly troubleshoot automation rule from Atlassian -

https://support.atlassian.com/cloud-automation/docs/debug-an-automation-rule/

Hope this also helps you.

Best, Joseph Chung Yin

Núria Rull Bassols
Contributor
May 31, 2024

Thanks a lot @Joseph Chung Yin I'll have a look on the link provided :) 

 

0 votes
Answer accepted
Kalyan Sattaluri
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.
May 30, 2024

Hello @Núria Rull Bassols 

Before your first If statement, log the 2 dates.

To do that,

  • go to Add Component -> New Action -> Log Action -> Put in -> Due Date is: {{duedate}}
  • go to Add Component -> New Action -> Log Action -> Put in -> Target Date is: {{customfield_10521}}

Once you have added above 2 new steps, rerun the rule by changing the due date and share screenshot of your audit log so we can take a look at output.

Thanks!

Núria Rull Bassols
Contributor
May 31, 2024

Thanks a lot @Kalyan Sattaluri it worked :)

 

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