It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to list all the users in a Role from a particular project

Sateesh Chandra Mar 31, 2014

Hi

Could someone help with a query to extract all the users in a particular role in a Jira project. Also help me with the extract of all the users in a group. Can I get the Full Name and the user name in the output.

Regards

Sateesh

8 answers

1 accepted

0 votes
Answer accepted
Sakthi Balaji Mar 31, 2014

Try like this,

SELECT U.* FROM projectroleactor P

INNER JOIN cwd_user U

ON U.USER_NAME = P.ROLETYPEPARAMETER

where pid = 'UR PROJECTID'

and projectroleid = 'ROLEID';

1 vote
Sakthi Balaji Mar 31, 2014

Hi sateesh,

can you try this Database query

select u.user_name , u.display_name, u.email_address from

cwd_user u inner join cwd_membership g

on u.id = g.child_id

where g.parent_id = XXXX

order by u.user_name;

Note:

XXXX - replace with the group id you wanted to list, you can get the id of the group from the below (cwd_group) table.

cwd_group will contain the Group Id and info about the group,

cwd_membership table will contain the User and group mapping.

cwd_user will contain the list of users created in jira

Thanks! Worked great for me!

0 votes
Nic Brough [Adaptavist] Community Leader Mar 31, 2014

What type of query? Plugin? Database?

0 votes
Sateesh Chandra Mar 31, 2014

Database query is fine.

0 votes
Sateesh Chandra Mar 31, 2014

Hi Sakthi,

It worked perfect. Can this be used to get the list of users in a particular role in a single Jira project.

Sateesh

0 votes
Sakthi Balaji Mar 31, 2014

Hi sateesh,

use this query for that,

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

0 votes
Sateesh Chandra Mar 31, 2014

It works but does not display FullName and Username though

Sakthi Balaji Mar 31, 2014

You can map the roletypeparameter value in the "projectroleactor" table with the user name in the "cwd_user" table.

0 votes
Sateesh Chandra Mar 31, 2014

Thanks Sakthi for the wonderful queries.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira Software

Early Access: If you use Jenkins and Jira Software Cloud, you need to read this!

The Jira Software Cloud Team has been busy working on a simple, secure, and reliable way to integrate your build and deployment information from Jenkins with Jira Software Cloud. This means you don’t...

229 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you