Auto-assign issue to user selected in a custom fields on status change trigger

Muhammad Khan April 27, 2023

Hi,

 

So I manage several projects that have the following structure.

 

Issues have custom fields:

1. Assigned Dev

2. Assigned QA

3. Assigned Reviewer

4. Assigned Dev Ops

 

And statuses are:

 

1. In Development

2. In Testing (BETA)

3. In Review

4. Verified (Pending Deployment)

5. In Testing (LIVE)

6. Done

 

I want to add automation to change the assignee of the issue based on it's status.

 

I want to do it like this:

 

When status -> "In Development", change the assignee to Assigned Dev

When status -> "In Testing (BETA)" or status -> "In Testing (LIVE)", change the assignee to Assigned QA

When status -> "In Review", change the assignee to Assigned Reviewer

When status -> "Verified (Pending Deployment)" change the assignee to Assigned Dev ops

 

Is this doable without adding a custom script?

 

I am open to any and all solutions. If custom script is the only solution, I would appreciate it if someone can point me towards a good tutorial/documentation on JIRA custom scripts.

1 answer

1 accepted

1 vote
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2023

Hi Muhammad - Welcome to the Atlassian Community!

Yes, you can achieve this with Automation Rules. Create a rule based on a trigger for Issue Transitioned. Select the Status it is transitioning to and then add a new action for Edit Issue. Select the Assignee field and then copy the value from the appropriate custom field. 

Muhammad Khan April 28, 2023

Hi John, Thanks for your answer.

Yes, I am aware of that. I tried it as well.

But the custom fields do not appear in the dropdown of values to copy from.

One option I saw was to add the action "Assign Issue" Instead, I did that and used the smart value of "{{customfield_Assigned Dev}}" but that automation rule just sets the assignee to "Unassigned".

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2023

Can you share a screen shot of the rule as you have it now? That syntax that you have is not correct for the field name. 

Are the custom fields all single user picker fields? They should show up to copy from. 

Like Muhammad Khan likes this
Muhammad Khan April 28, 2023

Yes, the custom fields are all single-user picker fields.

Here are the screenshots of the current rule:

assign-issue-on-transition.png

Here the custom fields are not appearing in dropdown:

another-field-value-or-comment.png

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2023

Use Edit Issue instead of Assign Issue. Choose Assignee and then see if you can copy the value from the Custom Field.

Like Muhammad Khan likes this
Muhammad Khan September 28, 2023

Hi John, I am very late in replying to this.

But I tried this out as well, I specified the Smart value using "Edit Issue" instead but it doesn't copy over the value, the automation runs successfully but it doesn't change the value.

Michael Corona
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 30, 2023

Did you ever get an answer for this Muhammad? I am trying to do a very similar operation.

Like Muhammad Khan likes this
Muhammad Khan November 30, 2023

No @Michael Corona , I never did manage to find a way to get this done.

The issue is in identifying the id of the custom field. I believe if the ID is correctly identified then the answer by @John Funk to use Edit issue instead of Assign Issue would work.

If you do find a way, please let me know as well.

Michael Corona
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 1, 2023

@Muhammad Khan  @John Funk I figured it out today.

You need to extract the accountId of the custom field in the automation rule. Essentially what you said, but there isn't a good way to extract that information until I used the Jira cloud plugin for excel. Some of the meta data for each custom field was shown that I started trying in the automation rule. 

This is all using the smart value type in the then trigger.

image.png 

So now my automation rule looks like this:

image.png

When I transition status, it now successfully populates the assignee with whoever is in that custom field.

Like Muhammad Khan likes this

Suggest an answer

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

Atlassian Community Events