Automation Assign Issue transition to someone who wasn't just working on it
Asked by Adrienne Van Halem:

I would like to create an Automation:
> When: Issue transitioned from In Progress to Ready for Review
>
> Assign issue to A user in a defined list, Round-Robin
>
> User list: X, Y, Z

But not the person who just did the last task.

Documents are being written and it needs to be assigned to someone new for review. ie. X,Y and Z are all on the list of people who can be assigned to, but X did the document writing, so Y or Z should review it.

Any way to add this rule? like a NOT {{assigned to}} limiter?

Thank you!


Answers:
author: Adrienne Van Halem
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637) Using 'Balanced workload' I've attempted to put

```
assignee != currentassignee
```

into 'JQL to restrict issues'.

I'm not sure if this will work as intended. It's allowed me to list users to choose from, does this function limit the selection of the assignee to be NOT the current assignee?

Small team. 3 people the flow could go to. 6 people who could be 'current assignee'

comments: author: Bill Sheboy
body: When using balanced workload with that JQL statement, the rule editor states that:
> The issue will be assigned to the user with the least amount of open issues assigned to them as defined by the jql. If multiple users have the same count, one will be randomly selected. For project scoped rules, only issues in that project will be counted.

So...I interpret that statement means if your JQL excludes the current user assigned from issues then *the current user is more likely to be selected*: they will have a zero number of issues returned by the JQL.


author: Simmo
body: That's right, the JQL is intended to help balance the load not filter out


author: Adrienne Van Halem
body: I was attempting to do it via Smart Value but I'm struggling with the syntax (not a coder). Would it be possible to do that way?


author: Bill Sheboy
body: Adrienne, would you please explain what you mean another way, as I am not understanding? Thanks!


author: Adrienne Van Halem
body: Right now I was trying to do it wrongly using the JQL filter, but there's a Smart Value option.

I was thinking {{assignee}} != {{currentassignee}} to generate a return where the person it is then assigned (reviewer) to is not the same as the one who it is currently assigned to (writer). And if this does work, is there a way I can also add specific people/group to the pool of who it chooses from?

X is writing it and is done. I want it to randomly choose from X,Y or Z who are reviewers, but I want to eliminate X as an option because they wrote it.

It could also be that A or B wrote it and therefore XYZ are all available for random review assignment.

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


author: Bill Sheboy
body: The "Assign the issue to"..."Smart value" does not work that way; it assigns to the one-and-only-one user identified by the smart value expression. For example, just to {{issue.reporter}}

As I noted earlier, I tried an experiment to dynamically create a list of users (e.g. X, Y, Z), remove the current assignee (e.g. X), and then randomly select from the remainder. That was not possible because of limitations in smart value processing.

(Specifically, a created variable cannot be used in a function for list filtering. Atlassian has indicated they do not plan to fix/change that behavior: <https://codebarrel.atlassian.net/browse/AUT-2430> )


author: Adrienne Van Halem
body: Thank you for the feedback and update, oh well, not going to happen. thanks for the info!


author: Bill Sheboy
body: Hi [@Adrienne Van Halem](/t5/user/viewprofilepage/user-id/5051442) -- Welcome to the Atlassian Community!

I do not think that is easily supported with out-of-the box features of automation rules. I suggest trying team or self-assignment instead.

More on your specific use case...

I just did a quick test and confirmed I was not able to do this with a created variable list of users. (The problem is the list function get() cannot take a variable as a parameter; if it did this would be possible by generating a random number to pick the next person.)

An elaborate work-around would be to create a Jira user group specifically for this assignment, replace the members with the REST API function to not include the current assignee, and then use the built-in random assignment.

Kind regards,  
Bill


author: Mark Segall
body: Hi [@Adrienne Van Halem](/t5/user/viewprofilepage/user-id/5051442) and welcome to the community!

The round robin could get quite complex. How many people are on the team?


Tags: assign