Hi everyone,
Good day!
I'm trying to create an automation rule wherein the custom field "SLA Overdue" will automatically be filled out using scheduled trigger. However, I cannot find the correct way to compare two dates. Basically, the rule will have to be based on priority and the number of days since the issue was created.
The conditions are as follows:
Condition 1: Low Priority (It must be resolved within 10 days)
If issuetype = defect and status != closed and priority = low and the date today is greater than issue.created.plusBusinessDays(9)
then set the value of SLA Overdue to "Yes"
Condition 2: Medium Priority (It must be resolved within 5 days)
Else If issuetype = defect and status != closed and priority = medium and the date today is greater than issue.created.plusBusinessDays(4)
then set the value of SLA Overdue to "Yes"
Condition 3: High Priority (It must be resolved within 2 days)
Else If issuetype = defect and status != closed and priority = high and the date today is greater than issue.created.plusBusinessDays(1)
then set the value of SLA Overdue to "Yes"
Condition 4: Critical Priority (It must be resolved within a day)
Else If issuetype = defect and status != closed and priority = medium and the date today is greater != issue.created
then set the value of SLA Overdue to "Yes"
Else set the SLA Overdue to "No"
These are some of the methods I tried to compare the current date and the date created:
Note: I'm trying to use the format date function to only compare the date (dd/MM/yyyy) and not the time (h:mm).
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
You are formatting dates for comparisons as "dd/MM/yyyy". That will not work as you expect because the values are text (when date formatting is used) and so a value such as "31/12/2023" will be greater than "01/01/2024" with a text comparison: the days are the first, left-to-right.
When comparing dates this way, use the jiraDate format as that is "yyyy-MM-dd", such as:
{{now.jiraDate}}
Kind regards,
Bill
Hi @Bill Sheboy
Thank you for your answer. I was able to make my automation rule worked by comparing the dates using jiraDate format.
This is my automation rule that worked:
Regards,
Jayson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn it is working! Please consider marking this question as "answered" to help others with a similar need find solutions faster. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The plusBusinessaction is to add and the store the information , then you can compare.
Suggestion:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good day!
Thanks for your answer. I have tried it using the lookup table but still didn't work. I have tried comparing the dates using jiraDate format as suggested by @Bill Sheboy and it worked.
Regards,
Jayson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.