set security level in transition depending on users rolemembership

Julius Hüttmann April 6, 2014

Dear all,

i wonder if anybody can give any advice to achieve the following:

We need to implement an mechanism which will set the issue security level in dependency to the new assignee role membership.

The Workflow extension (JIRA Misc Workflow Extension plugin in the version 2.5.7.1.) offers only the option to set the security level in the create-session transition. We need this over the whole WF in every transition.

Is this possible? Is there an script to use?

Thanks a lot and best regards

Julius

4 answers

1 vote
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.
April 6, 2014

As I said, this is not currently possible with the latest version of the plugin, but it could be implemented in a matter of days and provided to you in the form of a pre-release build. You would then be able to automatically set the issue security level based on the current assignee's project role.

But, as I said, JMWE 3.x is no longer free, so you would need to acquire a license (on the MarketPlace) after the evaluation preriod.

1 vote
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.
April 6, 2014

I'm not sure what makes you think the "Set issue security level based on user's project role" function works only during the Create transition. It can actually be used on any transition. But it is based on the user doing the transition, rather than the assignee.

The post-function could easily be extended to support setting the issue security level based on the current assignee rather than the trnasition author. However, this enhancement can only be implemented in a new version of JMWE (e.g. 3.3.1), not on 2.5.x, which we are not maintaining anymore.

If you are interested, and willing to upgrade the plugin (which is now paid-via-Atlassian), you should raise an issue on our issue tracker at https://innovalog.atlassian.net.

0 votes
Marco Paleani October 20, 2014

You can use the scriptrunnerplugin to add a postfunction in the create transistion on the first place at your workflow:

digagramm > Add Post Function To Transition > Script Post-Function > Set issue security level depending on provided condition

 

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.security.roles.ProjectRoleManager
import com.atlassian.jira.security.roles.ProjectRole
ProjectRoleManager projectRoleManager = ComponentManager.getComponentInstanceOfType(ProjectRoleManager.class) as ProjectRoleManager
ProjectRole guestsRole = projectRoleManager.getProjectRole("Guests")
projectRoleManager.isUserInProjectRole(issue.reporter, guestsRole, issue.getProjectObject())
0 votes
Julius Hüttmann April 6, 2014

Hi David,

thanks for your explanations.

I search for an possibility which let us set the security level automatically in decency to the role the new assignee is in.

Is this possible in the last version of your plugin?

We need to avoid failures by setting the security manually from the user which is assigning the issue and selecting the wrong security level….

Thanks a lot

Julius Hüttmann

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events