Forums

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

How can I get {{issue.Duedate.minuesDays(14)}} to work within smart value condition?

Cody Brown February 6, 2024

I have created the automation rule below. The action in the second if condition is not being accessed, but the first on is.

I am not sure what I am doing wrong. Any feedback/assistance is appreciated

 

Screenshot 2024-02-06 174602.png

2 answers

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 6, 2024

Hi @Cody Brown -- Welcome to the Atlassian Community!

Context is important for automation rules... 

Please post an image of your entire rule (ideally in one image) and an image of the audit log details showing the rule execution.  If there are multiple rule executions not working as you expect. please post each log and explain what does not work at you expect.

Until we see those...

This may be a case of either the conditions in the rule are not mutually exclusive or a misunderstanding of rule behavior.  Please note when using the if / else structure for a rule, the intention is at-most, only one of the cases will succeed.  Seeing your entire rule and logs may help to confirm this.

Kind regards,
Bill

Cody Brown February 8, 2024

The rule is to edit the Quick Status field based on the date. When the current date before the start date I want the status to be Not Started, when the date comes within 14 days of the due date the status must be Behind, when the date is between the start date and 14 days prior to the due date the status must be On track, and if the date is past the due date status is behind.

The issue is the On track status is not being changed. Issues are not passing the condition in the third condition field.

 

Order of conditions

checks at risk

checks behind

checks on track

check not started

new.pngaudit log.png@Bill Sheboy @Kalyan Sattaluri 

Cody Brown February 8, 2024

 .

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 8, 2024

Thanks for that information, Cody.

There are some untested assumptions in your rule, that we assume are valid (or could test for):

  1. Start date and Due date are not empty
  2. Start date is before the Due date
  3. Quick status should not be changed if it is already in the correct value

 

How are you using the Quick Status field: reporting, visibility of progress, etc.?  If it is just for visibility on the board, consider disabling this rule and using JQL queries with card colors to show each condition.

 

Assuming you still need to set the Quick Status, try these things:

  • I recommend disabling your current rule, and creating a new one from scratch
    • This will allow you to add one condition at a time to test the rule works as expected, building up slowly
    • If a test fails, stop and fix the rule before adding more conditions
    • During testing, the scheduled trigger's JQL could be changed to look only at specific issues and then later revised when the rule is completed
  • Change the JQL for the scheduled trigger such that only issues needing updates will be checked.  Specifically, do not check any Done issues or issues with empty values for Start Date or Due Date.
  • Date comparisons of date versus date / time values can have challenges in rules.  Perhaps use the compareTo() function to simplify your tests: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-compare---
  • Before changing the value of Quick Status, check if it is not already in the correct value.  That will improve rule performance and eliminate unnecessary updates of the issues.
  • Please note well: scheduled triggers, branches, etc. can only process up to 100 issues in an automation rule.  If you expect more this rule will need modifications to split the cases into separate rules.

 

0 votes
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.
February 6, 2024

Hi @Cody Brown  Welcome.

Can you clarify what do  you want the rule to do in big picture?

Also, Instead of smart values in your conditions, You probably could do the same checks with JQL .. 

So please clarify so community can help.

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