Forums

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

How can I see in which project a group is used?

Jean Coudert
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!
May 15, 2020

Hi everyone,

I'm not a specialist to write/execute JQL queries and I try to execute the Code below to get which projects are using a defined Group.

SELECT
pra.roletypeparameter AS "Group",
pr.name AS "Project Role",
p.pname AS "Project"
FROM
projectroleactor pra
LEFT JOIN projectrole pr ON pra.projectroleid = pr.id
LEFT JOIN project p ON pra.pid = p.id
WHERE
pra.roletype = 'atlassian-group-role-actor'
AND pra.roletypeparameter in ('helpdesk', 'administrators');

And I get an error: Error in the JQL Query: 'SELECT' is a reserved JQL word. You must surround it in quotation marks to use it in a query. (line 1, character 1)

Why do I've to use quotation marks on all SQL commands ?

Thanks

1 answer

1 accepted

3 votes
Answer accepted
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 15, 2020

Hello @Jean Coudert ,

Thanks for reaching out and looking at the example you are using the syntax looks formatted as a SQL style database query, from this KB:

But, this only applies to a Jira server instance and is run from the database directly on the systems backend,  If you are on cloud or doing a search on the front end in server the JQL search will use a different approach and syntax.

As a referance point I recomend checking out the advanced JQL documentation for a full breakdown on the avaliable syntax and options avaliable:

However JQL is going to be used to return a list of issues that meet a specific criteria and will not give you data on the layout of a project directly.

An option you could look at in Jira cloud is the API with a few different calls you can collect the details you are looking for.

You noted wanting the groups associated to a project, noting that you will need to itterate the call for each project and scheme. and ther is some additional discussion on this viewable in the following thread:

First you can get a list of projects and their permission schemes via a Get all permission schemes:

OR Looking specifically at the individual permission scheme via Get permission scheme grants:

using this endpoint it will give you the full breakdown of what users groups or roles are associated to the permissions of a project.

and if using roles you would also want to take the role id generated from the above query and pass it to Get project role for project API endpoint to see the users  or groups associated to that specific role via:

Regards,
Earl

Jean Coudert
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!
May 19, 2020

Hi Earl

Thanks for your full answer, I will spend sometime to understand how all his works but it seems to be quiet complex.

Regards

Jean

Like Earl McCutcheon likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events