How to change 'Assignee' based on a custom field on the Create Issue screen?

Hi,

I want to change the assignee field based on the value in the custom field.

For example, I have a cutom field called Location and it has 5 values. For the first 2 values of this custom field, the assignee should be a certain user1 and for the another 3 values, assignee should be a certain user 2. I do not want users to change the assignee and system should just assign the issue to the correct user based on the value of the Location field. How do I do this in JIRA?

I am not familiar with coding in JIRA and have recently started learning JIRA, so parden me if I have missed any straight forward funtion.

Regards,

Rumit

3 answers

Hi Rumit,

Use Script Runner by Jamie Echlin

https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner

And to help you with the script, check this out

https://answers.atlassian.com/questions/140304/groovy-post-script-to-assign-a-user-based-on-a-customfield

You will have to use it as a post-function in your issue creation step.

Hi Bhushan,

Thank you for your answer. I tried the solution in the links above. However, I have few questions with that.

1. I added a scripted field to my 'Custom fields' and added the script in the link above. When I go to Post Function of the 'Create Issue', I see an 'Script Post-Function' option where it is asking me to provide a 'Script File Path'. I don't know what value I need to give here. Please advise

2. Let's consider that I somehow resolve point 1, but, what it will do is, it will change the 'Assignee' feild AFTER user has clicked 'CREATE' on the 'Create Issue' screen. Correct me if I am wrong. If my understanding is true then I would like to clarify here that, I want the following functionality:

On the 'CREATE ISSUE' screen, when user selects a 'Location', Assignee field should be automatically populated with an appropriate value WITHOUT waiting for user to click 'CREATE'. Let me know if this is achievable.

Regards,

Rumit

Hi,

Can you explain me more

I think that there are several ways to do this; javascipt, jjupi, jpython, develop a plugin,...

Bhushan,

I get the script, but can you elaborate on exactly what post-function to use? Nothing really fits, nothing provides and area to just paste a script.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

177 views 1 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you