how to exclude holidays from BusinessDays

Giannis Michailidis May 2, 2024

i have created an automation for updating a field with a specific date when creating a ticket. Adding two days from today.

I have used the below expression

{{now.plusBusinessDays(2)}}

it is very good for saturday and sunday but it counts public holidays

do you know who to exclude also public holidays

2 answers

0 votes
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 2, 2024

Hi @Giannis Michailidis  As @Jeroen Poismans  said, it's not feasible to exclude public holidays in A4J because Jira won't store Holidays as different region or org have different holidays.  Here is the workaround, you can try to exclude holidays :

Create an issue in Jira and create a table in Issue Description to store the Holiday for the complete year. 

Using Regex compare the {{now.plusBusinessDays(2)}} result with table in Description field, if it won't match then put {{now.plusBusinessDays(2)}} in the field else if date matched then add +1 day in Result. 

Similar post : https://community.atlassian.com/t5/Jira-questions/How-to-change-working-days-in-jira-automation/qaq-p/2233093

Give it a try, let me know, if you face any issue.

 

Thanks

V.Y

0 votes
Jeroen Poismans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 2, 2024

Hi Giannis!

Out of the box I don't know how to approach this. With Scriptrunner you will probably be able to get this done but still you would need some "place" to store your holidays.

Do you have Assets? If so you might put your holidays in an ObjectType with of course a date as an attribute. From your automation you might the lookup the assets with a date in your range (today+2). 

If those assets (holidays) are found (eg 2) you can then add that extra amount of days. Do you get the idea?

Jeroen

Suggest an answer

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

Atlassian Community Events