(JIRA Misc Workflow Extensions) Use selected assignee only if member of required role, assigning not correctly

Andreas Beekma August 3, 2014

Product: JIRA Misc Workflow Extensions , Version: 3.5.1

Functional description:
Use the assignee selected on the transition screen if s/he is a member of the required role, otherwise assign to default role member.

I need a more detailed description of this functionality.

I have 2 groups defined. Business and IT. If the creator of the issue is in the group of business, the issue should be automatically assigned to the default user group business.

If the creator of the issue not in the group business should the issue be automatically assigned to the default user Project (lead).

Have i understood the functionality correctly or what am I doing wrong?

12 answers

1 accepted

0 votes
Answer accepted
Andreas Beekma August 4, 2014

I'm happy it works, thanks for support.

David _old account_
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.
August 4, 2014

You're welcome.

Please don't forget to "accept" the right answer.

0 votes
Andreas Beekma August 4, 2014

sorry, is this a button?

David _old account_
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.
August 4, 2014

Yes, I believe it's to the left of the answer (post).

0 votes
Andreas Beekma August 4, 2014

0 votes
Andreas Beekma August 4, 2014

The system ignore all entries. The Issue fetch up to the last User in the Role (Business User 2)

0 votes
Andreas Beekma August 4, 2014

0 votes
Andreas Beekma August 4, 2014

I despair...

Key defaultAssignee

Value CRM, Business

comma separated ?

David _old account_
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.
August 4, 2014

I gave you an example value:

RFC -> Business

You need to use that exact value (assuming your project key is RFC and the role Business).

You use commas if a user needs to be the default member of several roles, or in more than one project. For example:

RFC -> Business , DEMO -> Developer

will make the user the default member of role Business in the RFC project and of role Developer in the DEMO project.

0 votes
Andreas Beekma August 4, 2014

Correct, this is what i want. I change to "Force assignment" option of Business role an add the Groovy condition. See attachment. But I understand, according to the documentation functionality - define the default role member for the post-function, see attachment. ???

•Property key: defaultAssignee
•Property value: contains a comma-separated list of entries in the form ProjectKey ->


User Name in Property value ?

0 votes
Andreas Beekma August 4, 2014

David _old account_
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.
August 4, 2014

You need to go to the User you want to set as the default user for your Business role, and then edit their User Properties. You can use the following URL to get there quickly, replacing <username> with the real username (login) of that user, and of course your JIRA base URL:

https://<JIRA-URL>/secure/admin/user/EditUserProperties.jspa?name=<username>

Once there, you create a new User Property with key= defaultAssignee and value= RFC -> Business

(assuming RFC is the project key of the JIRA project, and Business the role name)

This will make that user the default member of the "Business" role in the "RFC" project (as far as the Assign to Role Member post-function is concerned).

0 votes
David _old account_
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.
August 3, 2014

This is not how this post-function works. It will always assign to the default member of the selected role (which, by the way, has nothing to do with JIRA's default role members - see the post-function documentation for details). If you use the "Use selected assignee only if..." option, it will use the assignee you select in the transition screen (only if that assignee belongs to the selected role).

Apparently, what you're looking for is different: you want the issue to be assigned to the default member of the "business" role only if the issue was created by a member of that role. Correct?

If so, you need to do three things:

- use the "Force assignment" option

- define the default role member for the post-function (see the documentation)

- add a Groovy condition to verify that the current user belongs to the appropriate role

The Groovy condition is not trivial. Try something like:

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.project.Project
import com.atlassian.jira.security.roles.ProjectRole
import com.atlassian.jira.security.roles.ProjectRoleManager

ProjectRoleManager projectRoleManager = (ProjectRoleManager) ComponentManager.getComponentInstanceOfType(ProjectRoleManager.class);
Project project = issueObject.getProjectObject();
ProjectRole projectRole = projectRoleManager.getProjectRole("Business");
return projectRoleManager.isUserInProjectRole(ComponentAccessor.getJiraAuthenticationContext().getUser(), projectRole, project);

Of course, you'll need to replace "Business" with the appropriate role name.

0 votes
Andreas Beekma August 3, 2014

If I use the functionality in the workflow all issues assigned to the default role member (Yan Müller),
whether I'm in the group Business or not.

I expect the issue to the default role member (Yan Müller) is connected, since the creator is in the group business, and if not in these Business Role, assigned automatically to the project lead use.

0 votes
Andreas Beekma August 3, 2014

0 votes
David _old account_
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.
August 3, 2014

Could you please describe what is not working the way you want?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events