How can I use automation to assign issues to a user in a group and exclude initiator?

Francois Turcotte November 7, 2024

I'm being tasked with ensuring that following certain transitions, sending an issue to code review for example, the issue is automatically assigned to someone in the group of reviewers.

My issue is that often the user that initiated the transition is also part of the group of reviewers and if I use the option to assign user in a group, that user can end up being assigned the review.

Is there a way to prevent that?

The way around this that I found is to have distinct cases for each reviewer but it gets tedious.

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2024

Hi @Francois Turcotte 

What method of assignment are you using?

If you are using round-robin, one workaround for this scenario is to check the assignee and re-assign.  For example:

  • trigger: issue transitions to "code review"
  • action: assign issue, from a group with round-robin
  • action: re-fetch issue
  • smart value condition:
    • first value: {{issue.assignee.accountId}}
    • condition: equals
    • second value: {{initiator.accountId}}
  • action: assign issue, from a group with round-robin

 

Kind regards,
Bill

Francois Turcotte November 7, 2024

Hello Bill,

I was indeed going for round robin and what you propose seems like a nice workaround, I'm wondering though if both actions "assign issue, from a group with round-robin" will use the same or different pools and end up reassigning the same user again.

I will do some testing.

Thanks!

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2024

In my testing, round-robin uses information associated to the last date / time the rule was updated / published.

After that point, the "counter" in the list starts and this allows the re-assignment to work for this scenario.  If you update / publish the rule later, the "counter" resets and starts again on the list of users from the beginning...but the re-assignment will still work to progress through the user list.

Francois Turcotte November 12, 2024

Thanks, it does seem to be working fine.

I'm wondering if you see a way to mix in a condition to also avoid assigning to a user on vacation?

I added a group Vacation and tried adding another if after / before the smart value condition but it does end up assigning a user that is either the initiator or in vacation.

  • user condition:
    • user: Assignee
    • Check to perform : is in group
    • Criteria : Vacation Group

Worst case I can change how my groups are made and include everyone who can't be assigned and use a condition to assign a user that is not in the group but I would need to actively manage more groups.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 12, 2024

Sadly, Jira Cloud does not have built-in functionality to manage stuff like working / non-working assignment for people who are in / out of office.  Such features are more in the space of service management projects.

 

I recall an earlier question related to this, and the limitation was: a dynamic user-list could not be generated during the rule AND used in the round-robin assignment. 

One workaround is using a group for "assignable-people" and to maintain that list, as you describe.  There are ways to also automate the update of that assignable-people group, although I have not tested that.  For example...

  • create a project specifically for tracking who is out-of-office, with issues for each person's out of office
  • use a daily run, scheduled trigger rule which scans those out-of-office issues, and makes updates to the assignable-people group using the REST API
  • use that updated group in your rule for assigning issues

 

Like Francois Turcotte likes this
Francois Turcotte November 13, 2024

Luckily I don't have that many groups to manage, sounds it will be just the first rule + manual management of the groups.

Thanks again for your assistance, much appreciated!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events