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
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.
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 :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Did you ever figure this out? My business days start on Sunday as well.
Thanks
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.