Forums

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

{{smart values}} condition

Riven Jing March 19, 2025

I created a rule as below:

 

First value: {{issue.created.diff(now).businessDays}}

 

Condition: less than

Second value: 1

But when the rule runnedcondition.pngcondition2.pngcondition3.png

 

, it said: "The following issues did not match the condition", no idea why it could not passed, the result should be less than 1

2 answers

0 votes
Duc Thang TRAN
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.
March 20, 2025

Hello @Riven Jing 

It will take complex automation to try to replace the function of the SLA plugin.

In my opinion, you can be inspired by this approach using the smart value {{issue.created.dayOfWeek}}.

 

If

  • First Condition:
    Check if {{issue.created.dayOfWeek}} is greater than 5. That means the day is either 6 or 7, which corresponds to Saturday or Sunday.

  • Second Condition:
    Use {{issue.created.toBusinessDay.diff(now).Days}}  is less than 1  (but keep in mind there can be inconsistent data, For example, if the ticket was created on Saturday, March 15 at 13:00, the smart value {{issue.created.toBusinessDay}} will return Monday, March 17 at 13:00 )

Then action : 

If 

  • First Condition:  {{issue.created.dayOfWeek}} is less than or equal to 5 
  • Second Condition {{issue.created.diff(now).Days}} is less than 1 

Then action : 

 

But this method works if your team operates 24/7, since "1 day" in date-time calculation equals 24 hours.
It’s better than dividing by 8 hours (assuming your team works 8-hour shifts) using diff hours 

 

Hope this can help 

 

0 votes
Mahesh Shinde
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.
March 19, 2025

Hi @Riven Jing

Welcome to Atlassian community!

In Jira Automation, {{issue.created.diff(now).businessDays}} calculates and returns the difference between the issue's creation date and the current date.

I am assuming, as per your ticket creation date is 19th March and response date is 20th March, so actual difference is 1days as the smart value counts the days but not in hours.

That could causing this issue.

Regards,

Mahesh Shinde

Riven Jing March 19, 2025

Hi @Mahesh Shinde ,

Thanks for your response! I supposed the result should be 0.X days and less than 1 because the difference is less than 24 hours. Is there any way to do this?

The purpose of creating this rule is to change the value of "Within SLA" to "Yes" if the difference between the current time and the creation time is less than one business day.

Thanks

Mahesh Shinde
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.
March 19, 2025

Hi @Riven Jing

If you try to compare the date difference in hours instead of buiseness days then let me know if it works for you.

Regards,

Mahesh Shinde

Riven Jing March 19, 2025

Hi @Mahesh Shinde ,

But I want to exclude the weekends when I compare the date difference. For example, if the Jira was created on Friday and we change the status of the jira on the next Monday, the "Within SLA" should also be "Yes".

Thanks

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events