I need to restrict Issues Creation, based on it Issue Type. For example, a Team member can create an issue of type "Technical Task" but cannot create a "Story". In that way, the role of the user in a project would determine the permission level to create an issue.
Is that possible?
No it's not. This forum is filled with questions about the same, just do a search.
Hi,
I solved this issue using Script runner's behavior, used below code in initializer and it showed Issuetypes based on logged in user, you can validate user against project roles or even groups
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE
def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager)
def allIssueTypes = ComponentAccessor.constantsManager.allIssueTypeObjects
def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issueTypeField = getFieldById(ISSUE_TYPE)
def availableIssueTypes = []
//use this def and if code to check project roles
/*def remoteUsersRoles = projectRoleManager.getProjectRoles(user, issueContext.projectObject)*.name
if ("Testers" in remoteUsersRoles)
{
availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Task", "Experiment"] })
}
*/
//use this def and if code to check groups
def remoteUsersRoles = ComponentAccessor.getGroupManager().isUserInGroup(user, "jira-administrators")
if (remoteUsersRoles) {
availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Task", "Experiment"] })
}
else {
availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Task"] })
}
issueTypeField.setFieldOptions(availableIssueTypes)
Hope this helps.
Regards,
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With this we can stop User groups from creating the issues, But users can move issues to issue type.
Is there a way to stop moving issues to particular type. Thanks in Advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This does not work for the jira cloud, because the appropriate API is missing. Any solution for Cloud version?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would advise the UI Filter:
https://marketplace.atlassian.com/plugins/net.youngaweb.jira.issue-type-ui-filter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Maybe you can set this using Issue Level security:
-https://confluence.atlassian.com/display/JIRA/Configuring+Issue-level+Security
-https://confluence.atlassian.com/display/JIRA/Setting+Security+on+an+Issue
Cheers,
Lucas Lima
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe not so nice, but there is a way
1. Make unique Workflow for each Type
2. In each workflow set in validator on Creation transition a specific Permission (like Set Issue Security, Delete All Comments, Edit All Comments, Delete All Attachments or Time Tracking Permissions which we are not using)
3. Create permission schema where assign this specific Permission to proper Group of users
at the end Group has right to create issues of specific Type
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just played around with the workflow and found out that a scripted validation (coming with the script runner plugin) on the create transition works pretty good as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This covers the 'Create' Transition, which is one case. Does Jira have any validator capability on the 'Edit' operation? Thanks, Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What exactly do you want to achieve? Maybe the Behaviour-Plugin which is now integrated in the Script Runner would help: https://jamieechlin.atlassian.net/wiki/display/JBHV/JIRA+Behaviours+Plugin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.