Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.
×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
Hi @Anita Domańska - Did the responses answer your question?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, @Charlie Gavey !!
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
This would take 2-4 rule components for each Holiday. So this would be a difficult rule to maintain.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
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.