Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Auto assign components to issues by workflow

Aspect Infra Team
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.
November 17, 2011

I need to auto assign issues by type to specific user

from my point of view hard-code assignee in a workflow is bad practice, so I want to create components for each issue type and assign a component to issue type. so assignee will be taken as component lead

is there any way to assign components to issue on creation?

I mean not by user, without showing field to reporter.

1 answer

1 accepted

1 vote
Answer accepted
Wojciech Seliga
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.
November 17, 2011

Hey,

It looks like you would anyway need to code some workflow post-function. In this case you wouldn't bother with creating fake components (which would be redundant with issue types anyway) but instead in this custom action just assigned newly created issues to people you want. To make it nicely configurable without spending too much time on UI, I would use Project Role concept here.

Just use some consistent policy for naming your Project Roles - e.g. create roles named: BugRole, ImprovementRole, TaskRole, etc. and then in your workflow post action assign the issue to the first (or whatever) person in <CurrentIssueType>Role.

Thus you will utilize JIRA project role management UI to do your stuff :)

Coding such post action is a piece of cake honestly (even for a beginner). I think you will end up with no more than a few dozens of Java lines of code.

There are some online tutorials which should help you, e.g.:

Cheers,

Wojtek

Aspect Infra Team
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.
November 17, 2011

Thanks Wojciech!

I'm already thinkin about such solution.

from my poin of view pros are - we even already have plugin installed to assign to role ;)

but cons are - we already use role management and with adding more roles ( one per issue type ) will create real mess

in the other hand - we didn't use componets as for now thats why i ask is there any way to assign components by function

and also i know at least 2 places where it also can be helpful in our Jira

so thans for answer and i'll comtinue to keep in mind such variant but maybe somebody khows aswer about components

Wojciech Seliga
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.
November 17, 2011

well, you are are so inclined to use components for that - just use exactly the same mechanism - but in your workflow post-action look for component leads (where your components will use I guess some consistent naming convention to easily bound them with issues types) and set the assignee. Use for it com.atlassian.jira.bc.project.component.ProjectComponentManager#findAllForProject to find all project components, pick the one you wish (deciding upon issuetype = component name) and then use ProjectComponent.getLead() to determne your new assignee.

Alternatively you could plug your own implementation of com.atlassian.jira.plugin.assignee.impl.DefaultAssigneeResolver , but AFAIK you would have to do it via v1 plugin :(

Filling assignee field (when auto-assign is selected) happens very early in the process of issue creation (actually that's on the boundary of UI and JIRA services) - and only late afterwards post-actions are called.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events