How do I export the users and roles page within a project?

Karan Ponnuthurai
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 28, 2021

Hi guys, I'm currently in the processing of auditing my Jira database and would like to export the Users and Roles page for each of my current active projects.

Is there a feature I can use to do this? I've tried to see if there is an export available but am not finding anything useful.

Any help is hugely appreciated.

 

Many thanks,

Karan

3 answers

5 votes
Levente Szabo _Midori_
Atlassian Partner
December 2, 2021

@Karan Ponnuthurai @Joseph Hani 

One way that wasn't mentioned yet is the User export feature of Better Excel Exporter. With a single click, it exports your users, their statuses (inactive/active), last login, roles and many more attributes:

jira-user-export.png

Joseph Hani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 2, 2021

Hello @Levente Szabo _Midori_ , 

I will take a look at this App, it can be really useful if it can also export all user and tell us in which AD group he is and in which project he is. 

Do you know if it can give the size of a project ? For example i'm looking for the total size of attachment in each project. 

I'm trying to code this but I know it would work only 1 project at a time. 

 

Thanks you for your help ! 

Regards, 

JH

Levente Szabo _Midori_
Atlassian Partner
December 3, 2021

Yes, it looks possible for a first glance by customizing the script behind the export template. You can find the documentation for customizing Excel reports here. Feel free to start a trial and open a support ticket with our technical support team if you have questions, they are ready to give you pointers. 

Leanne Viljoen April 17, 2024

Hi Levente, this is exactly what I need. We also have Better Excel, but can't seem to pull in Project Roles 

 

Regards,

Leanne

1 vote
Sergiienko Volodymyr September 8, 2022

Have a similar task. Main part:

import com.atlassian.jira.component.ComponentAccessor
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.security.roles.ProjectRoleManager
import com.atlassian.jira.security.roles.RoleActor;

final String projectRoleName = 'Testers' // use particular role, but can be redev to list or use all roles
final List<String> projectKeys = ['ABC', 'Project key(short name)']

ProjectManager projectManager = ComponentAccessor.getProjectManager()
ProjectRoleManager projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager)

//gets all project roles
def projectRoles = projectRoleManager.getProjectRoles()
ProjectRole projectRole = projectRoleManager.getProjectRole(projectRoleName)

String result
projectKeys.each{ String projectKey ->
    Project project = projectManager.getProjectObjByKey(projectKey)
    if (project) {
        ProjectRoleActors actors = projectRoleManager.getProjectRoleActors(projectRole, project)
        actors.getRoleActors().each { result += "${it.getParameter()}, type:${it.getType()}\n" }
      //  result += "$project.key, $project.name, $project.leadUserKey, ${actors.getUsers()*.name}\n"
    }
}
return result
Hope it helps somebody
p.s. Use Scriptrunner console for execution
0 votes
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2021

Hi @Karan Ponnuthurai 

What kind of information related to users and roles do you want to export?

There are some export options.

  • In Jira natively you can export the issues to a csv.
  • You can also take full backup of your instance to an XML file, so not very specific to your requirements.
  • You can pull data from Jira using REST API.
  • If you have access to database then you can always query your db.

If you are looking for active users, active projects, user login information, where users are referred in issues, permissions or something similar on these lines then I would say ScriptRunner for Jira can be used to achieve this. For instance this script will give you list of inactive users, this is of course one example but there are lot of possibilities when you use ScriptRunner for Jira.

I hope it helps.

Ravi

Karan Ponnuthurai
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 28, 2021

Hi @Ravi Sagar _Sparxsys_ , thanks for getting back so promptly.

I'd essentially like to export the information in below pages such as in the screenshot below. The very minimum I would require is the name of the user/group and which role has been assigned.

If there's a plugin within JIRA that can be used that would be perfect, but if not, that's perfectly fine as well.

2021-09-28 17_04_07-Window.png

 

Thanks,

Karan

Like # people like this
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2021

Also, I have made couple of videos on this topic.

I hope it helps.

Ravi

Joseph Hani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 1, 2021

Hey @Karan Ponnuthurai , 

Sorry to update your request, have you find any way to do it ? I have the exact same request :) 

 

I have found this solution, but maybe you have find another way, better one. 

https://community.atlassian.com/t5/Jira-questions/How-to-get-new-user-id-added-to-the-role-from/qaq-p/1590650

 

Let me know, 

Regards, 

JH

Suggest an answer

Log in or Sign up to answer