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).