Automate the assignment of issues if the user is not with something else in "in progress".
Asked by Valeria_Mejia:

Hello everyone

I would like to know how I can create an automation that assigns a new issue to a list of users but if the person already has something "in progress" it is not assigned and goes to the next user.

Thanks in advanced


Answers:
author: Bill Sheboy
body: Hi [@Valeria_Mejia](/t5/user/viewprofilepage/user-id/5090482) -- Welcome to the Atlassian Community!

Please take a look at the Assign User action, with the Balanced Workload option to see if that would meet your needs: <https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Assign-issue>

Kind regards,  
Bill

comments: author: Valeria_Mejia
body: Hi Bill,

The problem is that what I need in this case is that the issue to be assigned to any user who at that time does not have any other issue with the status "in progress", the Workload balance what it will do is assigned to the one who has fewer issues and that is not what we need.

For example:

List of persons

Valeria  
Pablo  
Mario  
Maria  
Sofia  
Luis  
Esteban

A new issue has been created and the next person on the list is Valeria in order but Valeria has another "in progress" case so the case will be reassigned to Pablo, if Pablo has another "in progress" case then it will go to the next one which would be Mario.


author: Bill Sheboy
body: Hi!

Please take a look at the comments from Luis on restricting the behavior of the Balanced Workload option, and...

Regarding your comment, Assign Issues does not "reassign" issues as you note. It will just assign them unconditionally based on the options selected.

Next for your scenario: what would you expect this rule to do if everyone has at least one issue in progress already?


author: Luis Machado
body: Hi [@Valeria_Mejia](/t5/user/viewprofilepage/user-id/5090482)

Welcome to the community!

Assuming you want this assignment to happen when an issue is created, I don't believe we can get exactly your request, but we can get close.

As a note, there is an inherent issue with trying to automate assignments based on whether the user has an issue assigned to them already that is "In Progress". Typically the rate at which you accrue issues to be worked out numbers the number of people you have to assign issues to. If you restricted it to only assign to users that have no "In Progress" issues assigned the rule could potentially just fail and the issue may fall through the cracks and not be assigned at all.

However, you can create an automation to assign issues in a balanced method using the "In Progress" status as the means of measuring workload.

For that I would suggest the following rule:  
![Screen Shot 2022-11-29 at 1.29.11 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/228173i0AF6FC5BFDB38247/image-size/large?v=v2&px=999 "Screen Shot 2022-11-29 at 1.29.11 PM.png")

The rule above is the basic premise for this automation. It fires off whenever an issue is created, and assigns the issue to someone in the project role specified in a balanced manner based on how many issues that user has assigned that are in the "In Progress" status. It doesn't keep users from being assigned to more than one issue, but it does balance out the workload across the team.

There are a number of ways that this can be altered to fit a specific situation but this at least gives you a starting point. Hope this helps.

comments: author: Valeria_Mejia
body: Great, Luis, I will try with that, just one more thing, is it possible then that if using this option, for example, everyone has something in "in progress" the issue remains unassigned until one is free?


author: Darryl Lee
body: The documentation isn't explicit, but I'm going to \*guess\* that if everyone has the same exact same number of issues in progress, then it probably "falls back" on Random.


author: Luis Machado
body: [@Valeria_Mejia](/t5/user/viewprofilepage/user-id/5090482)If everyone has something in progress, it will first assign to the person that has the least amount of assigned tickets. To [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322)'s point if everyone has the same amount assigned it will select someone at random.

If you're worried about meeting SLAs and making sure folks only have issues they have the bandwidth to handle in a certain amount of time, it might be a better approach to have a process in place with a triage queue that folks pull from, rather than trying to automate the assignment. If you're using [Jira Service Management this functionality is built in.](https://support.atlassian.com/jira-service-management-cloud/docs/what-are-queues/)


author: Valeria_Mejia
body: [@Luis Machado](/t5/user/viewprofilepage/user-id/3743773) I was doing some tests and among them I tried the scenario in which nobody in the list of people has an issue in "in progress", i.e. everybody is free and it turns out that in that case the issues are still assigned to the same person instead of going to the next person in the list.

Is there any way to correct this in this same balance Workload rule with the JQL "status = "In Progress""


author: Darryl Lee
body: Hi [@Valeria_Mejia](/t5/user/viewprofilepage/user-id/5090482) it would be helpful if you shared a screenshot of your rule. Did you make it similar to what Luis posted? Because what he shared looks like it would work.

OH, one thing I was wondering is that you put the first ticket into "In Progress" and that same person was assigned a ticket? That seems like a bug. But if the first ticket wasn't moved, it's certainly conceivable they would keep getting tickets, because the JQL would not exclude them.


author: Luis Machado
body: [@Valeria_Mejia](/t5/user/viewprofilepage/user-id/5090482)I might know the issue, the example I gave you was intended to be a basic implementation that you could build off of. I don't have any context around your workflow structure or your reporting needs, etc. so I didn't want to get too much into the weeds with it. I suspect this is the scenario you're encountering:

* Ticket 1 is created and is assigned to User A but doesn't immediately get transitioned to "In Progress"
* Ticket 2 is created and is also assigned to User A before Ticket 1 is transitioned.

If that's the case you can add another action to your rule that will also transition the ticket to "In Progress" after it is assigned. It would look like this:

![Screen Shot 2022-11-29 at 6.14.43 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/228229i4A604E7E979368C5/image-size/large?v=v2&px=999 "Screen Shot 2022-11-29 at 6.14.43 PM.png")

If your scenario is different can you please provide some additional context and a screenshot of your rule as Darryl suggested?