Hi All,
I need to calculate Working Day/ Business Day of the Month, when the Ticket is created.
For Example: If ticket is
created 3rd May 2021, i.e. Monday, then Working Day=1
created 11th May 2021, i.e. Tuesday, then Working Day=7
I also need to exclude National/Bank Holidays.
Is this possible any how, using JQL, Calendar, Groovy Scripts?
I was able to calculate working days, but not exactly how I want using below JQL
created >= startOfMonth() and created <= startOfMonth("+7d") and created >= startOfWeek("+1d") and created <= startOfWeek("+5d")
Finally able to calculate Working days using below method.
Trigger: When Issue Created
Then Edit issue Field
"First Business Day" = {{now.firstBusinessDayOfMonth}}
"Created Date" = {{created.jiraDate}}
Re-Fetch Issue Data
IF Issue created on First Businesss Day
Created Date = First Businesss Day of Month
cf[11240] = {{issue.created.firstBusinessDayOfMonth.jqlDate}}
Then
Edit Issue Field -> "Working Day" = 1
ELSE IF Issue created on 2nd Businesss Day
Advanced Compare Condition
[ "First Businesss Day" - issue.created ] = 1
{{issue.customField_11241.diff(issue.created).businessDays}} = 1
Then
Edit Issue Field -> "Working Day" = 2
ELSE IF {{issue.customField_11241.diff(issue.created).businessDays}} = 2
Then
Edit Issue Field -> "Working Day" = 3
ELSE IF {{issue.customField_11241.diff(issue.created).businessDays}} = 3
Then
Edit Issue Field -> "Working Day" = 4
ELSE
<Whatever>
Have you used the automation rule for this?
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.
I also used the automation rule but I am getting the below error:-
I am using the "Start Date" Field instead of using the "First Business Day" Field.
I am also seeing Smart Values Documentation. but I am not getting the solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried dropping the, "Start Date" = at the beginning of your string? I would try just:
{{now.firstBusinessDayOfMonth}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Aashutosh Kumar ,
getting the day of the week might be possible but holidays might be harder/impossible.
what would your use case be?
if this is for SLA then you can just configure it with a Calendar object to specify working days and Holidays.
I’d be happy to think along but if u can elaborate a bit on your use case maybe we can think of a way to work this out
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dirk Ronsmans
At least calculating the Working Days even without Holidays would work for me.
I need to calculate if Ticket is created within X working days or not and process it further, like:
If Ticket created on Working Day 1
Then Do X
Else If Ticket created on Working Day 2
Then Do Y
Is there any possibility to use calendar from SLA?
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.