Assigning round robin according to the hour of the day
Asked by Mark Cartwright:

Hello,

I'm looking to auto-assign tickets to my global team according to the hour of day the ticket is created.

Team members come on and off shift at different times so I'm using the Else-if blocks to check on the hour and then assigning round robin to whomever is on if the condition for that block is met:  

![block.png](https://community.atlassian.com/t5/image/serverpage/image-id/136553iA290CB0835C6971C/image-size/large?v=v2&px=999 "block.png")

This isn't working so can anyone advise on why please?

Many thanks in advance,

Mark


Answers:
author: Mark Cartwright
body: It works perfectly if you remember to turn the rule on!

Sorry all

comments: author: Jack Brickey
body: Ha, love it! That is an interesting automation rule. You should consider sharing the entire flow for future searchers.


author: Mark Cartwright
body: Absolutely happy to do that! What's the best way to do so? Start a discussion, or just paste here?  

Thanks.


author: Jack Brickey
body: Well if you have permission to write an article that would be cool and then paste the link here. If not just paste here would be welcome too! Cheers


author: Sandy
body: Hi, was this ever posted or shared? We so need this. Thanks


author: Mark Cartwright
body: Hi Sandy, sorry, I hadn't done so yet but will take the time today to do it.


author: Mark Cartwright
body: The rule is a trigger then a bunch of else-if blocks for each change of engineers shifts during the day. Essentially you're creating a pool of available engineers to take the tickets according to the time of day they are working.

The trigger is simply a schedule of every 5 mins.

The example here has someone come on at 9am (1 person) and then more come on from 10am.

So the first else-if block checks the hour (24hr format) using {{issue.created.format("H")}} as the value, then the condition is a match for 9 so will be for every ticket created from 9:00 to 9:59am.

The action off the back of that is to assign to that engineer who is working (sorry I had to use Automatic as I was using the Playground for the screenshot.)

The next else-if block is for when more engineers start so the value to check is for all the hours they are on shift, working together (in this example from 10am to 4pm).

The action then assigns the ticket round robin to those engineers. You'd have to define who they are and don't have to use round robin obviously.

All you need to do after that is create either of these two types of else-if blocks for when a change occurs in that pool of engineers, for example, when they leave for the day. In my example perhaps that person who started at 9am finishes a 4pm but there's some other engineers who work on. You'd need to create an else-if block to reflect that remaining group of people and the hours they are working together.

![Rule.png](https://community.atlassian.com/t5/image/serverpage/image-id/141219i15D7C7308F1420C7/image-size/large?v=v2&px=999 "Rule.png")

It has a bit of an overhead as you need to manually add and remove people for holiday, sickness etc. but we're finding it works just fine. Better than the alternative of constantly asking the engineers to pick up tickets!

I hope that explains it for you but am happy to answer any questions.


author: Marina Vital
body: Thankss!!


author: baraaabbas
body: Hello,

If time is not 24H format how to do time then?

(8AM\|9AM\|10AM\|11AM\|12PM\|1PM\|2PM\|3PM4PM) is this correct


author: Alexandra O
body: [@baraaabbas](/t5/user/viewprofilepage/user-id/3715916)

How are you? I was trying it as the example shared by [@Mark Cartwright](/t5/user/viewprofilepage/user-id/2505994) and it didn't work.

Did you manage to find out how to do it with the am or pm hours?


author: baraaabbas
body: Nope, no luck!


author: Kapil Joshi
body: Here is what we did. If else block for each shift making sure there is no overlap.

![automation.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/213407iE10C6B95410876E1/image-size/large?v=v2&px=999 "automation.jpg")

![automation2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/213408iE04FBE5288968B3F/image-size/large?v=v2&px=999 "automation2.jpg")

![automation3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/213409i0F0C83AE225F7FCA/image-size/large?v=v2&px=999 "automation3.jpg")

For some reason round robin did not work with Jira group so I used "A user defined list" option.

![rr.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/213410i4AE61216B105398A/image-size/large?v=v2&px=999 "rr.jpg")