Jira automate - user select custom field

Justin Berneburg August 5, 2021

Does anyone know if it's possible to use round robin 'assignment' logic on custom fields that are a user picker?

For example, if you had a custom field (user picker) titled 'Implementation Consultant' and you wanted the value to automatically be set using round robin between John, Sally and Steve, could you use Jira automate to do that? 

I see that it's easy to do this for the 'assignee' field but I haven't seen the ability to do it for custom fields that are user pickers.

Any help would be appreciated. The custom fields don't necessarily reflect who is assigned the work at that given moment, but more so who will be responsible for the work when it get to a certain point in the workflow.

Thanks.

1 answer

1 accepted

2 votes
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.
August 5, 2021

Hi @Justin Berneburg 

There is an open backlog to add this suggested feature: https://codebarrel.atlassian.net/browse/AUT-273

Until something like that happens, you could hard-code the logic or work-around and leverage the function using the assignee field:

  • trigger: whatever you are using
  • action: create variable to save the current assignee
  • action: set assignee using round-robin for your people list/group needed for the custom field (Consultant)
  • action: re-fetch the issue to load the new "assignee"  (Consultant)
  • action: edit issue to copy the "assignee" to your custom field  (Consultant)
  • action: edit issue to set the assignee back to the value in the created variable

Another option: there might be a marketplace addon to do this without automation, so that may be worth a search also.

Best regards,
Bill

D_ontreye Nero April 28, 2023

Thanks, Bill!

To those trying this method, be sure to use {{assignee.accountId}} for the variable, NOT {{assignee.displayName}}.

Like Bill Sheboy likes this
Kelton Stewart October 16, 2023

Hi @Bill Sheboy , I am trying to use this suggestion in a similar fashion to D_ontreye but with a slight twist. We have a custom user picker field named "Reviewer" this reviewer could be any one of 3 assignees from the current issue. We do not want the reviewer to ever be the same as the assignee of the issue. Do you have any idea of a work around to use round robin and not have it set the reviewer the same as the assignee? 

 

Thanks, 

Kelton

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.
October 16, 2023

Hi @Kelton Stewart -- Welcome to the Atlassian Community!

I do not believe there is anything out of the box to do that for a separate custom field AND to exclude the current assignee.

If you have a fixed number of people, I could imagine more elaborate work-arounds (which I have not tried) to implement random or round-robin selection:

  • Random
    • create a variable which contains a comma-separated values (CSV) list of the account id values for the users, and so there are N1 users
    • using text functions, remove the value for the current assignee (which lowers the count by 1
    • using the math functions random() and floor(), generate a number between 0 and N-2 (because lists are 0-based in rules)
    • use that number to select the next user's account id
  • Round-robin
    • a variation of the "random" method, uses a fixed ordering of the users...stored again in a created variable
    • using text functions, remove the value for the current assignee (which lowers the count by 1
    • using text functions, find the account id value after the current reviewer
    • add special handling for reaching the end of the list (so it wraps back to the beginning)

Another option: investigate the Atlassian Marketplace to see if some vendor has built this capability as an addon app for fields.

Kind regards,
Bill

Kelton Stewart October 17, 2023

@Bill SheboyThanks for the quick response! I think I have found a possible solution (albeit a very drawn out one) by using a series of else-if statements to evaluate the current assignee using a variable and then assign to a defined list that excludes that user. My only issue now is that my if evaluation is always coming up false, when I expect it to be true. The screenshot below shows my variable as the first value and the specified user as the second value and for some reason, this if statement comes back false when I am expecting it to be true. Is there anything you can spot that would cause an issue?

Screenshot 2023-10-17 094310.png

Kelton Stewart October 17, 2023

@Bill Sheboy I figured it out. I was using the ~accountId: and brackets, which I learned are only for evaluating user comments. I removed that and got the automation to work as expected. Thanks!

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events