Hello Community,
We are using Jira Cloud Premium.
I'm trying to calculate duration (working days) between 2 custom date fields (e2e tests start and e2e tests end) using automated rule that inserts this value to another numeric field.
I calculate the number with this rule:
{{issue.customfield_13297.diff(issue.customfield_13298).businessDays}}
However Jira Cloud supports advanced management of working days (adding bank holidays/non-working days) only the Board level and I need my rule to work across one Jira project for all Epics...thus I wondered is there any way to get businessDays of one Board where these days are defined?
Or maybe there is already some known app / solution that I didn't find (I searched a lot) that allows to calculate working days including public holidays between 2 custom date fields?
Thank you in advance!
Anita
There is no REST API call to get the non-working days for a board, so you may need to either look for a marketplace addon or hard-code the values in an automation rule and use math, list, and smart value filtering functions to count them (and then subtract from the built-in working days diff).
Kind regards,
Bill
Hello @Bill Sheboy - thanks for quick reply and checking on this.
Can you please advise how I can hardcode non-working dates? I'm not so good with Advanced JSON field edition in automation.
I tried even the simplest one to assign the value (working days amount between two date fields) to my custom field, to avoid situation custom field is renamed - automation stops working. So I thought the best way is to use this advanced script and unique ID of my custom field.
I attached 2 screens - first shows standard way of assigning field - all works, advanced - shows errors: "Error while parsing additional fields. Not valid JSON."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Anita!
Let's break this problem down into pieces:
First, when trying to diff those two custom fields for the dates, try just writing that to the audit log first. That will confirm if you have the syntax for the date diff correct before trying to update the field.
Next, what I meant for the date comparison was to put your bank holiday date in a created variable as a string (e.g. 2022-01-25) and than use the date compare functions to determine if the holiday is within the range of your start/end date. If it is, decrease the working days accordingly.
One last thing: in edit issue image you show, you are both changing a field and using the advanced edit for JSON. Is the "KPI EAD11..." field the same as "customfield_13333"? If so you cannot do both in the edit so pick one method: without or with the JSON.
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 !
Great thanks for your hints. I will do as you suggested and will try with the hardcoded holidays values.
To answer your last questions - I use another custom field for this, not the same as KPI EAD11 - as Im aware of the conflict.
Thanks,
Anita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Next, what I meant for the date comparison was to put your bank holiday date in a created variable as a string (e.g. 2022-01-25) and than use the date compare functions to determine if the holiday is within the range of your start/end date. If it is, decrease the working days accordingly.
It seems that this is not possible and I don't find a practible example to compare a date with a date in a date range
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With the current capabilities/limitations of using created variables in rule functions functions...the only possible work-around I have found for this was chaining math conditions of greater than or equal to (gte) and less than or equal to (lte) on the date: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/ as I recall those accept variables.
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.