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

Automation weekdays and weekends

david_contreras March 18, 2021

Hello everyone, I work in a sales company and I need to configure an automation to assign leads to different salespeople (agents) depending on whether it is a weekday or weekend

the first step of automating is when the incident or lead is created, after that I don't know how to continue

1 answer

1 vote
Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2021

Hey @david_contreras ,

I assume you mean your trigger is defined then as "issue created"? 

The next step imho would be to add in an IF condition which has a JQL. You could then build a JQL that looks at what day of the week the issue was created.

Jira does not have a weekday or weekendDay function so you have to do some trickery.

I tend to use the startOfWeek() and endOfWeek() functions.

For my "weekdays" If I would add this JQL: 

created >= startOfWeek() and created <= endOfWeek(-2d)

The weekend days would then be 

created >= endOfweek(-2d) and created <= endOfWeek()

This would be my starting point.

david_contreras March 19, 2021

Good morning, yesterday I tried it and it worked very well, however today (Friday) the automation assigned issues to the agents designated for the weekend :(

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 19, 2021

Hey @david_contreras ,

I think that might be with the 2nd JQL

Can you change that to

created > endOfWeek(-1d) and created <= endOfWeek()

That would make more sense as endofWeek() = Sunday and then -1d would be Saturday.

By doing -2d we include Friday (which is fine for the first JQL i guess..

david_contreras May 4, 2021

It did not work for me, I investigated and
startOf Week () starts Sunday 00:00 h
endOfweek () is Saturday just before Midnight

That is why it did not work before, I tried with this function, it assigns me the weekdays well, however the weekend function does not assign Saturday but Sunday yes, help please

For weekdays
created >= startOfWeek(1d) and created <= endOfWeek(-1d)
The weekend days
created > startofweek(-1d) and created <= startOfWeek(1d)

Mya_Hauck December 2, 2021

@david_contreras 

Hi David,

Did you ever figure this out? My business days start on Sunday as well.

Thanks

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events