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

Assign requests to agents based on the hour of the day/on-call schedule

Do you have a need to assign incoming requests to different agents based on the hour of the day? In most cases teams do have this need, or at least my team does. So how do you do this in JSM. Well, you have three options that we will look at, the first one is to use automation.

In this example we are assuming that each agent is coming on-line on the hour, and we are not considering local time zones, instead we are basing the schedule on UTC (Coordinated Universal Time), that is how JSM stores the date/time data.

 The automation will trigger when a request is created, and it will check the hour the request was created using the smart value {{issue.created.format("H")}}

You can then create if/else condition to check the hour and assign to the agents that are covering it. Each if/else condition can either cover a single hour or multiple depending on how your coverage schedule looks like. In the example below each if/else covers two or more hours.

Assign based on working hour.png

My take on this - this is a good way to get started. The drawback is that if there is a change in the schedule you would have to go in and modify the automation, and if you want multiple people to be able to do that then they have to be project admin in order to access the automation. You would also have to maintain the schedule outside of JSM if you want users to know who is available to be assigned requests.

 

The second option that we will look at is a combination of automations, the on-call schedule in JSM, and an iPaaS application. In this example we will be using tray.io which is a low-code workflow builder that allows you build integrations and automations.

We will be using two automations, the first one triggers on when the request is created and will send a web request with the issue key and the web hook URL for the second automation to the tray.io workflow. The second automation is the one that sets the assignee.

Get on-call responder.png 

The workflow in tray.io will use the Opsgenie API to get the current on-call responders and filter them out from the response. If there are one or more responders on will be picked based on round-robin and the responder’s Atlassian Id is returned to the second automation that sets the assignee.

 Round-robin workflow.pngSet on-call responder.png

My take on this - If you have multiple on-call responders during the day this is a good option. Agents have access to the on-call schedule from within JSM and can also go in and update the on-call or override it if people are out. It can also scale if you would like to apply this to multiple on-call schedules/teams with just a small change to the first automation and the tray.io workflow. The drawback to this solution is that you would need to use a third-party product.

 

And the last option that I will mention here is to use one of the apps in the Marketplace that allows you to auto-assign based on a schedule. A quick search shows that there are a handful of apps that can do this, so that is definitely worth a look.

My take on this - Apps are definitely worth a look, since they can easily solve your use case without having to invest too much time.

 

If you have implemented something similar or have any questions let me know in the comments below.

5 comments

Rimantas Andrulevičius August 2, 2024

Hey @Mikael Sandberg ,

Why not use the JSM on-call feature to assign the issue?

Screenshot 2024-08-02 at 13.51.13.png

At a deeper level my question is - how to maintain consistency and a single source of truth with assigning logic? Atlassian promotes using JSM premium with Affected Services and On-call teams. Maybe there is a solution with automations to set an issue assignee based on the affected service set on the issue and the service owner team member which is on-call?

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 2, 2024

Hi @Rimantas Andrulevičius

as I mentioned above, setting the assignee using the on-call responder component In automation currently only works if you have one person on-call at the time. If you have multiple people on-call at the same time the component will always pick the person in the on-call list. This is the reason for using the tray.io workflow.

The affected services currently only sets the responders field, it does not set the assignee.

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 2, 2024

And don’t get me wrong, affected services and on-schedule works perfectly whit Incident management as long as you only have one person that is on-call at the time. And you could set the assignee based on who acknowledge the alert, but for service requests, like peripheral requests or password reset, you normally don’t associate with a service.

Ahmed Arslan September 5, 2024

@Mikael Sandberg This is pretty useful info, just wondering where are you defining the agent working hours? 

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 5, 2024

@Ahmed Arslan The working hours/on-call hours are defined in a on-call schedule under JSM Operations (previously in Opsgenie).

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events