Assign Issue Based on Field Selection

KeriB April 5, 2012

Hello,

We are wondering if there is any way to auto-assign issues based on a field selection. We need to add a field that will essentially be sub-projects (as we don't want to have hundreds/thousands of JIRA projects), and were hoping that when someone selects a sub-project it could assign the issue to a certain user, which we would specify for each field choice. Basically what we'd really like is a field just like components, as you can auto-assign to the component lead. Is there any way to do this, or are we best off just making these more components or making them JIRA projects? Any advice is appreciated.

Thanks!

KeriB

2 answers

1 accepted

0 votes
Answer accepted
Dieter
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.
April 5, 2012
Hi KeriB, Of course using more components seems obvious but sometimes this is not possible since the subprojects use the same components and thus they are already "in use". In this case having a dedicated custom field subproject makes sense to select the subproject. This field could be select list or even a cascading select list if you have something like sub-subprojects. The actual mapping subproject => subproject-assignee and subproject => subproject-team-members-group-name can be stored in groovy post function. This post function reads the value of custom field subproject and then looks up assignee and the name of the subproject team members group in the map. These values are set in the issue using issue.setAssignee and issue.setCustomFieldValue(teamgroup-cf,team-members-group-name). The group custom field teamgroup-cf is used in permission schemes to grant right for the group working on the subproject. Of course you could also store a mapping subproject => subproject-team-members-role but this might lead to many project roles which in larger environmet may confuse user of other projects. Unfortunately project roles are visible in all projects (not sure yet about Jira 5) Hopefully you got some ideas how to organize subprojects within one Jira projects
Dieter
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.
April 5, 2012
Sorry for the bad formatting of my answer, but this is what answers.atlassian.com produces with iPad input ;)
KeriB April 5, 2012

Hi Dieter,

Thanks very much for your response. It sounds like it may be doable and work how we'd like. Is this groovy post function something we would have to custom write, or is it available in a plugin? Also, do you think this would be really hard to manage, like anytime we update something like a workflow, add sub-projects to the list, etc?

Thanks for your help!

KeriB

Dieter
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.
April 5, 2012
I'm not aware of a plugin that is ready to use. As you see from answer it would require some place where to store the mapping table. I personally do all this in a groovy script developed on my own. I have varying use cases, e.g. Some times the assignee cannot simply be looked up in a table but is computed also based on some other conditions. To stay flexible i code this in groovy. Maintaining a groovy script is simple, all changes there become visible immediately. Adding a subproject in your case would require two changes: add a new option to the select list custom field and adding a line in the map that is defined in the groovy script. This is not too much effort if you have just some new projects per week.
KeriB April 5, 2012

Thank you so much for all of your help Dieter! I am going to share that info with my boss and see if she thinks we have resources to build something like that, or just go for the groovy script for now. I really appreciate your insight though.

Dieter
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.
April 6, 2012
I don't know how many developer resources you have but if of course it would be the most maintainable solution if you could code all that in a java based plugin since makes it easier to code unit tests, forces type safety and is easier to deploy. In daily business we are often under pressure to release solutions asap which odten leads to groovy solutions. We are trying to avoid that whereever we can but the more complicated the business case is the more likely we get a groovy solution
Dieter
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.
April 6, 2012
I also think you can keep the groovy scriptnflexible enough so you just can copy the post function for a new workflow. The script lives in a file on the filensystem and is just referenced by the file name from the groovy post function
Dieter
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.
April 6, 2012
Glad if can hel :) Let me know the way you go
Gaven Ray April 7, 2016

Can someone give an example script for this? I am wanting to do something similar and am no good at writing my own scripts. Dyslexia causes me issues getting everything written out right.

0 votes
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2014

Hi,

JIRA Enhancer Plugin (from 4.3.5 version on), has a post function "Assign to a user in role according to a field in the issue".

Regards

Suggest an answer

Log in or Sign up to answer