Issue with Jira Cloud Automation Rule Counting Weekends.

Saraswathikotala September 6, 2023

Hello Community,

I've encountered an issue with a Jira Cloud automation rule, and I'm hoping someone can help me resolve it.

 I've set up an automation rule to count field changes in an issue from Monday to Friday. However, it appears that the rule is also counting changes on Saturday and Sunday, which is not the intended behavior.

 Is there a way to configure the automation rule to exclude weekends (Saturday and Sunday) from the count? I want it to operate strictly on weekdays.

Any guidance or suggestions on how to achieve this would be greatly appreciated.

Thank you in advance for your assistance!

 

Best regards,

[Kotala Saraswathi]

 

Feel free to customize this request as needed and then post it in the Atlassian Community to get help with your issue.





 

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2023

If I understand correctly you want the date difference calculation to exclude weekends and your current calculation is:

{{now.diff(issue.created).abs.days}}

As per the documentation concerning smart values for date and time:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

...if you look at the diff function you will see that it has an option for business days.

Screenshot 2023-09-27 at 3.13.15 AM.png

Saraswathikotala September 27, 2023

@Trudy Claspill Monday to Friday 

Saraswathikotala September 27, 2023

@Trudy Claspill  i want smart value {{now.diff(issue.created).abs.days}} in issue aging filed  only need to count Monday to Friday.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2023

Refer to the answer I provided. Use the businessDays option instead of abs.days

If you want it to always be a positive number then use businessDays.abs

As per a note farther down in the document "BusinessDays (business days are considered to be Monday to Friday, 9am to 6pm)"

Saraswathikotala September 27, 2023

@Trudy Claspill  thanks for you reply.

 

i don't have idea in automation. that's why I have one more doubt. please tell me.

 

(business days are considered to be Monday to Friday, 9am to 6pm)" if i created issues after 7pm to 8am it will count are not?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2023

I don't know. I suggest you create a version of the rule that uses a Manual trigger and only prints the result of the calculation to the Audit Log, and then trigger the rule from issues created outside of the 9 am to 6 range and review the results.

Saraswathikotala September 27, 2023

@Trudy Claspill like this i am getting error.

 

Screenshot 2023-09-27 172905.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2023

That image does not show a rule that is using the date diff function, which is the context of this Question post.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2023

No action done is showing like this.

The message in the Audit log indicates that no qualifying issues were found. Check the JQL in your trigger to confirm that it is finding issues. Also note the checkbox below the JQL in the trigger. In addition to matching the JQL the issues must also have had some update since the last time the rule ran, otherwise they will not be considered.

Saraswathikotala September 27, 2023

@Trudy Claspill in JQL its showing 133issues.

Screenshot 2023-09-27 181533.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2023

Have any of them changed since the last time the rule was run?

Screenshot 2023-09-27 at 5.50.09 AM.png

Saraswathikotala September 27, 2023

@Trudy Claspill actually its running rule every day mrg 9am Monday to Friday. when start Monday running rule its counting Saturday ,Sunday also.  below given screenshot.Screenshot 2023-09-27 181958.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2023

That history information is from September 11. You just changed the rule today, September 27, so that it would not include weekends in the calculation. The information from September 11 is not relevant to the rule today.

Have any of the 133 issues selected by the JQL been updated in any way (status change, field updates) since the last time that the rule was executed?

The issues must have been updated in some way since the last time the rule was executed or they will be ignored by the rule. That is what the checkbox means in the last image I posted.

If you want the rule to recalculate the information even if the issues have not been updated then you need to uncheck the box.

Like Jack Brickey likes this
Saraswathikotala September 27, 2023

@Trudy Claspill 

@Trudy Claspill Good morning

the businessDays option instead of abs.days. this rule is working but its came None Screenshot 2023-09-28 102412.pngScreenshot 2023-09-28 102429.pngScreenshot 2023-09-28 102456.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 28, 2023

You have a typo in the smart value. Remove the blank space between "business" and "Days".

Screenshot 2023-09-28 at 12.11.43 PM.png

Saraswathikotala October 3, 2023

@Trudy Claspill  Thank you so much. Rule is working

Like Trudy Claspill likes this
0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2023

Hi @Saraswathikotala , can you share an image of your rule with the details on your conditions for business days?

Saraswathikotala September 26, 2023
Saraswathikotala September 26, 2023

@Jack Brickey  can you help on above requirement 

Saraswathikotala September 27, 2023

@Trudy Claspill  No action done is showing like this.Screenshot 2023-09-27 173831.pngScreenshot 2023-09-27 173902.pngScreenshot 2023-09-27 173940.png

Suggest an answer

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

Atlassian Community Events