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

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.

Hi Elif,

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

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

926 views 5 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot