I created a rule as below:
First value: {{issue.created.diff(now).businessDays}}
Condition: less than
Second value: 1
But when the rule runned
, it said: "The following issues did not match the condition", no idea why it could not passed, the result should be less than 1
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
{{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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.