Jira MySQL query that returns project names, that...

Hi every one. Need help with SQL query that will return me names of all projects, in witch "SOME GRUP" is not member of "SOME PROJECT ROLE"

Somthing like:

SELECT * FROM projectname WHERE jira-group(or user) NOT IN project-role;

3 answers

1 accepted

Right answer is:

select projects.pname from jira.project as projects 

inner join jira.projectroleactor as pa on pa.PID = projects.ID 

inner join jira.projectrole as pr on pr.ID = pa.PROJECTROLEID

where pa.ROLETYPEPARAMETER = "<here my group name>" and pa.PROJECTROLEID != 10800

 1080 i got from jira.projectrole and its ID of my needed project role.

Is it mandatory requirement to use SQL only? Could you use REST, for example?

In my case it`s the only way to get needed information.

0 votes
Alexey Matveev Community Champion Oct 30, 2017

That would the SQL Query

select * from jira.project a where not exists
(SELECT pid FROM jira.projectroleactor b where
roletypeparameter = 'USER OR GROUP' and a.id = b.pid)

Thank you, so much. You answer is not absolutely applicable in my case, but it gave me right direction. 

Suggest an answer

Log in or Join to answer
Community showcase
Pedro Felgueiras
Asked 35m ago in Jira

Clone a Zephyr issue

When I try to clone a Zephyr issue only a popup showing the issue id and nothing more shows.  On the browser console I see:  RTE not registered Error: No jira/editor/registry at c...

9 views 0 0
View question

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot