Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Igor Pryadunenko October 30, 2017

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

0 votes
Answer accepted
Igor Pryadunenko October 30, 2017

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.

0 votes
Alexey Matveev
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.
October 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)

Igor Pryadunenko October 30, 2017

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

0 votes
Domenico Manzo [Actonic]
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.
October 30, 2017

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

Igor Pryadunenko October 30, 2017

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

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events