set security level in transition depending on users rolemembership

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

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.

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.

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

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())

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

320 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you