Custom Issue Type Permission/Security

Hello,

I have a custom issue type and trying to change the permissions to determine who can create JIRA Issues under that Issue type.  Is it possible?

How can I determine the security/permission levels on the workflows? All I see is Permissions/ Roles under the projects. Where can I change the security/permission level of a workflows?

Thank you!

3 answers

This widget could not be displayed.

this thread has a couple of solutions.

https://answers.atlassian.com/questions/161095/restricting-issue-creation-of-certain-types-based-on-user-project-role-group

 

you can probably also set the properties of the transitions .. some documentation here. You probably need a workflow specific to that one issue type.

https://confluence.atlassian.com/jira/workflow-properties-189949.html

This widget could not be displayed.

For the "Create" transition, you have to do it as a validator, as you can't add conditions to "Create".  This is a minor issue in that, depending on how they reached create, they could have filled in the whole form and not have a way to change the type when it gets rejected.  I still use it though, to keep everything except "Bug" and "Improvement" reserved for people in the Developer's Role:

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
import com.atlassian.jira.security.roles.ProjectRoleActors
import com.atlassian.jira.security.roles.ProjectRole
import com.atlassian.jira.project.version.Version
import com.opensymphony.workflow.InvalidInputException
import com.opensymphony.workflow.WorkflowContext
import org.apache.log4j.Category

def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction");
ProjectRoleManager projectRoleManager = ComponentManager.getComponentInstanceOfType(ProjectRoleManager.class) as ProjectRoleManager


ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getUser();
ProjectRole devsRole = projectRoleManager.getProjectRole("Developers");
ProjectRoleActors devs = projectRoleManager.getProjectRoleActors(devsRole, issue.getProjectObject());
Boolean isDev = devs.contains(currentUser);
String issueType = issue.getIssueTypeObject().getName();


if (!isDev) {
	if (issueType != "Bug" && issueType != "Improvement") {
        invalidInputException = new InvalidInputException("You are not a member of this project's \"Developers\" role; the only issue types available to non-developers are \"Bug\" and \"Improvement\".");
    }
}

I pulled some irrelevant code, but hopefully it still works as-is.

This widget could not be displayed.

Hi Elif,

You can do both by adding conditions on your workflow transitions.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

207 views 1 3
Join discussion

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