Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Changing automatic assignee based on given custom field

Burak Özkanlı July 26, 2022

Hey everyone, ı have a question about auto assignee in Jira. I have an ıssue type which called "Documentation" .  In this issue type ı have a status " Document Controlling". I want the issue to be automatically assigned according to the custom filed value in during the document controlling status. For example ;

Vendors (Custom Field Name)

  • White Co
  • Black Ltd.
  • Red Company

if the Vendors is choosen like "White Co" >>> assign this issue to Mr. Burak

if the Vendors is choosen like "Black Co" >>> assign this issue to Mr. Yusuf

How can ı do this. Thanks for your help. Best regards

7 answers

Suggest an answer

Log in or Sign up to answer
5 votes
Anne Saunders
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.
July 26, 2022

I use a handful of rules like this to manage a multi-step approval workflow we use for our documents. I'd build it like this:
Conditional Assignment Rule.png

You will want to be careful about turning this on as a global rule because it will EAT UP your automations for the month. I'd limit it to as few projects as possible, or assign a copy to each project to avoid that.

You can also be cautious about how you set up that "Field Value changes for:" and limit your automation usage that way - if it looks at all field value changes for every kind of event, that's a lot.

Burak Özkanlı July 26, 2022

Hey Anne,

Thanks for SS. workflows changes, while the vendors field does not. I only use automation from the "in progress" state to the "Document Controlling" state. 

As I said, I ran it with automation. I just do not want the user to change more than one assigne on the screen.For ex, Automatıon changes assignee. If the user doesnt refresh the page, he will change assignee again. That is not useful.

Anne Saunders
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.
July 26, 2022

That's actually how I use mine -
"When: Issue Transitioned" to Internal Review (my custom status)
IF
(Condition 1) "Task Type (my custom field) Contains Estimate"
THEN
(Action 1) "Assign to my estimate approval user"

OR
(Condition 2) "Task Type (my custom field) Contains Hosting Contract" 
THEN
(Action 2) "Assign to my Hosting Contract approval user"

It works perfectly for me. 

Like # people like this
3 votes
Kelly Arrey
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.
July 26, 2022

As an aside, if you make 

  • White Co
  • Black Ltd.
  • Red Company 

values in the component field, then you can make Mr. Burak the Component Lead for White Co., Mr. Yusuf the Component Lead for Black Ltd., and make the Component Lead the Default Assignee for those components.

Burak Özkanlı July 26, 2022

Can this solution be used when moving from one specific status to another? For example, someone else will be working on this issue at the beginning of the work. It will only be assigned to specific person during the "Document controlling" status.

Lauren Allen
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.
July 26, 2022

Unfortunately not.  The default assignee for a component only gets set on creation of a new issue

Like # people like this
3 votes
N Gobiananth July 26, 2022

It's pretty straightforward, you can simply achieve this using Jira automations. 

Project settings --> Automations

probably you can implement a 'Issue fields condition' followed by a  'Issue created' trigger.

Burak Özkanlı July 26, 2022

Hi Gobiananth , I tried it and it worked. But there is a point here. When I use the automation trigger I have to refresh the issue display page for the working the automation. If the refreshing is not done, there is no assignee change. This situation may confuse the user. So I want automatic change without having to refresh the page.

Leonard Hussey July 26, 2022

Ah! if the answer to this comes in this thread, I'll be golden.

I have same issue: UI does not refresh.

Anne Saunders
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.
July 26, 2022

The UI sometimes lags a bit. The new assignee will get an email telling them they're assigned once the UI catches up to the backend, and it will look right to them.

Like Connor likes this
1 vote
Amir Katz (Outseer)
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.
July 28, 2022

Another option to consider is to add a post-function in the relevant transitions.

  • Unfortunately, Jira has a limited set of PFs for assignment.
  • Some add-ons (JEP, JMWE) provide their own PFs for assignment.
  • You can also roll your own scripted PF if you have either JMWE or ScriptRunner.

Downsides:

  1. You have to add the PF in each relevant transition. Note that JMWE has a nice PF called 'Shared Action' where you create a PF once and then you can reuse it in many transitions and workflows.
  2. There may not be a PF that does exactly what you require
1 vote
Amir Katz (Outseer)
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.
July 27, 2022

Regarding the solution using components, there are two problems (inherent to components):

1. Any Jira user can add a component, from the issue screen, so you may end up with "White Co", "White Corp" and "White Company". One small comfort is that the values are case-insensitive so you can't have "White Co" and "white co".

2. Components is a multi-selection field, so it makes any automation and scripting more complicated.

I use components strictly for auto-assignment of issues and trust my users not to add new components...

Burak Özkanlı July 27, 2022

Hey Amir,

As @Lauren Allen said, The default assignee for a component only gets set on creation of a new issue. I wanna use this assignment fro spesific statuses.  It will only be assigned to specific person during the from status "X" to the "Document controlling" status.

Connor
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.
July 28, 2022

Hey @Amir Katz (Outseer) regarding your first point, I think you're confusing labels with components.

For components, users can select components to add to the components field, but only project or Jira admins (users with Administer Projects permission) can create/manage components. Related Atlassian documentation here and here.

For labels, users with the Edit issues permission are able to create labels and add/remove them from the Labels field. When creating a new label they are case sensitive, so 2 users could create separate labels of "CompanyA" and "companya". But when searching within the label field, or JQL, the search functionality is case insensitive. So searching for "CompanyA" will return "CompanyA" and "companya".

Amir Katz (Outseer)
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.
July 31, 2022

I'm not confusing between the two, but you are correct about adding components - I'm an admin, so Jira lets me add components. Other users, non-admins, cannot do that.

So I stand corrected, thank you.

1 vote
Ray Tran July 26, 2022

We have done this using groovy scripts built into the workflow. Of course, you need an add-on like Jira Workflow Extension.

Amir Katz (Outseer)
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.
July 27, 2022

In general, I try to stay away from groovy code as much as possible. They're difficult to debug & maintain and are not easy to parse for other people.

If an add-on (such JMWE, JSU, ScriptRunner) or Jira built-in (automation) provides a functionality that does not require coding, I would prefer it.

Like # people like this
1 vote
Leonard Hussey July 26, 2022

Hi,

Automation for JIRA would be an option.

Set it to be triggered on updates to your Vendor field.

build it to check who is the vendor with IF or IF ELSE "conditions", then "action" component to set the assignee.

Would be a long if, if-else tree. 

Limitation x64 components per automation (I think) so in theory: up to 32 vendors per automation.

You can build more than one automation for this. They'd run in parallel.

TAGS
AUG Leaders

Atlassian Community Events