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!
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 thread has a couple of solutions.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Elif,
You can do both by adding conditions on your workflow transitions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.