Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,712
Community Members
 
Community Events
184
Community Groups

Can we reach to the non-working days from the Jira board via automation?

Edited

Hello Community,

I would like to exclude non-working days when calculating business days between 2 custom dates and then take -x days (probably using function .minusDays(x)).

{{issue.customfield_13359.diff(issue.customfield_13332).businessDays}}

Is it possible to reach the non-working days defined in one Jira board?

I would like to use it via Jira automation.

 

Thank you,

Anita

3 answers

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 22, 2022

Hi @Anita Domańska  - Did the responses answer your question?

0 votes
Charlie Gavey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 03, 2022

Hi there,

I’ve linked your suggestion to a related feature request, which counts as an upvote for this ticket:

https://codebarrel.atlassian.net/browse/AUT-100

Thanks for letting us know.

Cheers,

Charlie

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 03, 2022

Thanks, @Charlie Gavey !!

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 03, 2022 • edited

Hi @Anita Domańska 

That is not possible yet with built-in features.

There is no REST API method to get at those non-working day settings in the board configuration: https://community.developer.atlassian.com/t/rest-api-getting-non-working-days/9851

I tried this same use case a few weeks ago, experimenting with a hard-coded holiday date list in a created variable, and used smart value list filtering/math functions and was not successful.  If you store the list in a project entity property, with attribute names, I suspect it would be possible...although that would duplicate your non-working days in two locations.

The other work-around is a series of if/else blocks and repeated edit/re-fetch actions.  With a lot of non-working days this might not fit within the 60 component limit for automation rules.

Kind regards,
Bill

Hello @Bill Sheboy -
Thank you for your reply! Did any of your workarounds worked? Is it possible you could share here the code you used for these if/else blocks?

Thank you,

Anita

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 03, 2022

Sorry, as I ended up abandoning this use case for now after the created variable technique didn't work. Here is the question I posted to learn if someone else had solved this with lists.

To do this with condition tests, you would do something like this:

  • if/else condition
    • add a condition to check if the start is less than or equal to the Holiday using diff() and lte()
    • add a condition to check if the end date is greater than or equal to the Holiday using diff() and gte()
    • action: whatever you need to exclude the holiday...probably an edit or a created variable
    • action: if you did an edit, you then need a re-fetch
  • ...repeat for each holiday

This would take 2-4 rule components for each Holiday.  So this would be a difficult rule to maintain.

Like Thies Uhlenbruch likes this

@Bill Sheboy 

Im just starting ... :-)

Do you have a simple automation example for one holiday? For my use case i only need 4-6 holidays so that would be no problem. I have to manipulate hundreds of issues so I don't want the manual work for the calculation.

Thank You

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 01, 2023

Hi @Thies Uhlenbruch 

I do not have an example rule for this as I am unclear of what your scenario is.  Perhaps consider adding a new question and linking to this one for context.

An example advanced compare condition to test a range would be:

  • first value: {{#if(and(issue.some begin date.gte(holiday date), issue.some end date.lte(holiday date))}}true{{/}}
  • condition: equals
  • second value: true

Kind regards,
Bill

Hi @Bill Sheboy 

thank you for your help. I used your compare condition example but it doesn't work. So to make it easier I give you my example. Maybe my logic doesn't work well :-)

 

customfield_10307 = 2022-12-04

dueDate = 2022-06-01

variable = Allerheiligen (value 2022-11-01)

  • {{#if(and(issue.customfield_10307.gte(Allerheiligen), issue.dueDate.lte(Allerheiligen)))}}true{{/}}
  • condition: equals
  • second value: true
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 04, 2023

Hi!

The math operators only operate on number and date values, and created variables are text.  Please try adding .toDate so your variable is converted in the comparison's functions, such as this:

{{#if(and(issue.customfield_10307.gte(Allerheiligen.toDate), issue.dueDate.lte(Allerheiligen.toDate)))}}true{{/}}

Also, what is the type of your field customfield_10307?  Is that a date field?

Suggest an answer

Log in or Sign up to answer