Hi
Could someone help me with a way / script / query wherein I can extract the list of all the users who have access to a particular Jira project. The project is currently using both Users and Groups in the Roles and Permissions
Regards,
Sateesh
Hi Sateesh
try this query in Database, projectroleactor will give you the list of users who have access on a particular project.
SELECT * FROM `projectroleactor`
where pid = 'XXX'
and projectroleid = 'yyy';
u can get the pid (project id) from the below table.
SELECT * FROM `project`;
projectroleid u can get from
select * from projectrole;
Regards
Sakthi
Open permission scheme used for a project. Check to which(Users / Groups / Project Roles) have you provided "Browse Projects" permission.
Count them together.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the error I get.
javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script3.groovy: 1: unable to resolve class ProjectRoleService @ line 1, column 20. ProjectRoleService projectRoleService = (ProjectRoleService) ComponentAccessor.getComponentOfType(ProjectRoleService.class); ^ Script3.groovy: 1: unable to resolve class ProjectRoleService @ line 1, column 41. eService projectRoleService = (ProjectRo ^ Script3.groovy: 2: unable to resolve class ProjectRoleManager @ line 2, column 20. ProjectRoleManager projectRoleManager = (ProjectRoleManager) ComponentAccessor.getComponentOfType(ProjectRoleManager.class); ^ Script3.groovy: 2: unable to resolve class ProjectRoleManager @ line 2, column 41. eManager projectRoleManager = (ProjectRo ^ Script3.groovy: 3: unable to resolve class ProjectManager @ line 3, column 16. ProjectManager projectManager = ComponentAccessor.getProjectManager(); ^ Script3.groovy: 5: unable to resolve class Project @ line 5, column 9. Project project = projectManager.getProjectObjByKey('ASC') ^ Script3.groovy: 6: unable to resolve class ProjectRole @ line 6, column 13. ProjectRole administrator = projectRoleManager.getProjectRole("Users"); ^ Script3.groovy: 8: unable to resolve class ErrorCollection @ line 8, column 17. ErrorCollection ec = new SimpleErrorCollection(); ^ Script3.groovy: 8: unable to resolve class SimpleErrorCollection @ line 8, column 22. ErrorCollection ec = new SimpleErrorCollection(); ^ Script3.groovy: 9: unable to resolve class ProjectRoleActors @ line 9, column 19. ProjectRoleActors existingActors = projectRoleService.getProjectRoleActors(administrator,project,ec); ^ Script3.groovy: 11: unable to resolve class User @ line 11, column 8. Set<User> users = existingActors.getUsers(); ^
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to include the required imports. Please read up on groovy scripting. Use these imports:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.bc.projectroles.ProjectRoleService; import com.atlassian.jira.security.roles.ProjectRoleManager; import com.atlassian.jira.project.Project; import com.atlassian.jira.project.ProjectManager; import com.atlassian.jira.security.roles.ProjectRole; import com.atlassian.jira.security.roles.ProjectRoleActors; import com.atlassian.jira.util.ErrorCollection; import com.atlassian.jira.util.SimpleErrorCollection;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the groovy script to which shows all the users under Administrator role. Add code for required roles:
ProjectRoleService projectRoleService = (ProjectRoleService) ComponentAccessor.getComponentOfType(ProjectRoleService.class); ProjectRoleManager projectRoleManager = (ProjectRoleManager) ComponentAccessor.getComponentOfType(ProjectRoleManager.class); ProjectManager projectManager = ComponentAccessor.getProjectManager(); Project project = projectManager.getProjectObjByKey('<PROJECT KEY>') ProjectRole administrator = projectRoleManager.getProjectRole("Administrators"); ErrorCollection ec = new SimpleErrorCollection(); ProjectRoleActors existingActors = projectRoleService.getProjectRoleActors(administrator,project,ec); if (existingActors != null){ Set<User> users = existingActors.getUsers(); // Do your thing } return
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Look this link, it can give you what do you need.
https://answers.atlassian.com/questions/163400/does-jira-log-admin-s-changes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First, you need to define what you mean by "access" to the project. The right to see issues in it? Be in one or more specific roles?
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.