Automating round robin assignment for different shifts in Jira Server Automation
Asked by Rabbit Stoddard:

I am using the Automation plugin for jira server in jira Service Management for this. I have three shifts of service desk workers, and I want to do round robin assignments for each shift. My requirements are thus:

* shift 1 is 8 AM-5 PM
* shift 2 is 11AM-8 PM
* shift 3 is 12AM - 9 AM
* the project lead needs to be able to change people between shifts without contacting the admin (me).

The problem is that between the hours of 11 AM and 5 PM, I have two different shifts working. I was intending to use roles to do the assignment, but you can't specify two roles in a round robin.

What I tried next was setting an entity property on the project for Last Assignee, with a value of either 1 or 2 for whichever of the two overlapping shits was assigned, and then using if/else to switch up assignment, as follows:![projectProp.png](/t5/image/serverpage/image-id/120736i153DFAF3D2A95609/image-size/large?v=v2&px=999 "projectProp.png")

Now, my notation could well be off (I also tried project.properties.myProperty), but it looks like while Automation can set properties all day long, <https://codebarrel.atlassian.net/browse/AUT-83> indicates that it can't actually read them, except for issue properties. Which aren't useful in this case, because I need to know what role for the assignee in the /last/ created ticket in order to set the next one. It would be much simpler if I could just specify two roles, otherwise I'll have to create yet another role for the overlap period, add everyone in both to it, and then it will show on all projects, even where it isn't relevant.

Anyone have thoughts on this?


Answers:
author: Darryl Lee
body: So [@Rodney Nissen - ReleaseTEAM](/t5/user/viewprofilepage/user-id/18744) posed a question about this in the [Innovalog "Stump The Expert Challenge"](https://www.innovalog.com/challenge), but for the life of me, I can't figure out how to use JMWE to do it. (Sorry Innovalog.)

The challenge is "Round-robin issues based on time zones" - sound familiar?

But he also recently posted ["Give Me A Break"](https://thejiraguy.com/2020/12/23/give-me-a-break/ "\"Give Me A Break\""), a tutorial on how to create a project/workflow + automation that will allow users to remove themselves from a Service Agent role when they are on vacation (and also bulk-assigning their tickets to whoever is covering for them).

Anyways, thinking about the challenge, I found your question again and am sure Automation is the way to go for this, but as to your last requirement, I think Rodney's tutorial kind of nails it.

Having a project/workflow that uses the Automation Web Requests to hit the JIRA API to add/remove users from the rotation groups would allow for "self-service" for the project lead.

---

And oooof. Now that I reread your original question, it doesn't even look like having the project lead be able to manage the groups was the issue. It was the whole double-shift thing. Whoops. Did you ever figure that out?

comments: author: Rodney Nissen - ReleaseTEAM
body: To be fair, we did call that challenge a "mind-bender"


author: Rabbit Stoddard
body: They wound up not needing it anymore, so I was able to not have the overlap group. Which solved it for me in the broad, but it'd be worthwhile to figure it out just as an exercise.


author: Darryl Lee
body: Are you wrapping project.properties.myProperty in curly braces?  

It's a smart value, so you'll need to do: {{project.properties.myProperty}} to check it.

comments: author: Rabbit Stoddard
body: Yes. This is what it looks like in the editor:

![log value.png](https://community.atlassian.com/t5/image/serverpage/image-id/120750i51E8BD24359EEA0B/image-size/large?v=v2&px=999 "log value.png")![Screenshot 2020-12-03 152923.png](https://community.atlassian.com/t5/image/serverpage/image-id/120751i1656E02BDE56918E/image-size/large?v=v2&px=999 "Screenshot 2020-12-03 152923.png")

and I tried this in both the {{projectProperty.lastAssignee}} and above formats, with the same result. If the format is still again something different... well, that could very well be so.


author: Darryl Lee
body: OH! I forgot the quotes. For some bizarre and undocumented reason, you have to put Property names in quotes:

Try this: {{project.properties."lastAssignee"}}

I got this tip from [@William Sheboy](/t5/user/viewprofilepage/user-id/788946)  

<https://community.atlassian.com/t5/Jira-Core-questions/How-do-I-access-a-User-entity-s-properties-set-via-API/qaq-p/92490#M51725>


author: Bill Sheboy
body: Yup, it looks like project properties can now be read from the automation rules.

Here's an unrelated tip if you try to organize your entity properties better (such as with a namespace organization): the key cannot ***always***contain a period. It definitely doesn't work for project entity properties, and I have seen some posts that it does work for issue entity properties. Curious... I submitted a defect for this to learn if this is just a documentation gap versus a defect.

__Bill


author: Rabbit Stoddard
body: Do you have to use the quotes when you set the property as well, on this screen?

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


author: Bill Sheboy
body: No, you just set the property with no quotes around the key.

If you are wondering if there is an issue even setting the property, you may also just do a quick check in a browser using the REST API to grab the values:

<https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-properties/#api-rest-api-3-project-projectidorkey-properties-propertykey-get>


author: Rabbit Stoddard
body: I haven't got this working yet, but I am pretty sure it's something I'm doing wrong on my side. I was able to confirm that the property isn't actually getting set with the API call, so I'll start there.


author: Bill Sheboy
body: [@Rabbit Stoddard](/t5/user/viewprofilepage/user-id/4159074) if you post your current rule maybe the community will see something to help.

__Bill


Tags: cloud

jira-server

jira-service-management