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

Rumit Patel May 2, 2013

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

0 votes
Jeremy Cejka August 29, 2013

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.

0 votes
Nadir MEZIANI
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.
May 4, 2013

Hi,

Can you explain me more

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

0 votes
Bhushan Nagaraj
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.
May 2, 2013

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.

Rumit Patel September 11, 2013

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

Suggest an answer

Log in or Sign up to answer