As an admin, I should be able to list all projects a specific user has access to. How to do that using the REST API without too convoluted code still escapes me... Any idea how to do that gracefully? Thanks!
I am afraid you will have to make multiple calls in that case.
https://docs.atlassian.com/jira/REST/latest/#d2e4366 gets you all users with given permission in a project.
https://docs.atlassian.com/jira/REST/latest/#d2e2710 gets you the project role view.
Hope one of these helps.
None of these links go to a specific set of the documentation anymore.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jobin Kuruvilla [Adaptavist], unfortunately those links points to nothing and I am working on a similar problem.
Hope you could help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The older links are now broken it seems. There is a new experimental API which you can try out. It gets the job done in one call.
Check out "Get permitted projects"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello @Jobin Kuruvilla [Adaptavist]. I would like to find the groups for a specific user but the api https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-permissions-project-post only accepts a permissions array. please can you help me? thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the "Get User" API to get all user details including the group memberships. See https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-user-get
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mentioned link are broken.Can you guys help in getting project details and permission a user have.
I have user details with me,and wanted to know all project that user has access.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the late answer!
We had the same issue and wrote a plugin which extends the REST-API of Jira. You can specifiy a user and get the users projects and the permissions and roles assigned to the projects. You can also filter for specific permissions.
The plugin can be found here:
https://marketplace.atlassian.com/plugins/de.materna.jira.plugins.userProjectRest
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jens,
do you some example ?
i try this method but it isn't work for me. return 404 :(
https://<jira-domain>/jira/rest/userprojectrest/1/project?user=xxxx
(in post method, with good parameters in plugin)
thanks a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you for your answers. I am looking for a way to fetch (browse) all projects a particular user (not me) has access to. No need to create. Using /rest/api/2/project works indeed, but that gives me the list of all projects visible to me as a JIRA admin.
I can do what I want through Jira's web interface: "JIRA Administration" / "User management", then "Projects Roles" for a specific user. I am looking for a way to emulate that using the REST API, being logged in as a JIRA Admin. Hopefully without too many looped calls... Thanks again for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Depends on what access you are looking for. If it is 'Create', use what @Volodymyr Krupach suggested.
If you are looking for all projects visible to the users (Browse access), use GET on /rest/api/2/project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
He Luigi,
You can do it with /rest/api/2/issue/createmeta: https://docs.atlassian.com/jira/REST/latest/#d2e550
Piece of my JavaScript:
var projUrl = "/rest/api/2/issue/createmeta"; var availableProjectsArr = []; jQuery.ajax({ url : projUrl, headers : { "Accept" : "application/json" }, success : function(jsonStr) { var json = $.parseJSON(jsonStr); for (var i = 0; i < json.projects.length; i++) { var project = json.projects[i]; availableProjectsArr.push(project.key); } ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just out of interest: where do you use JavaScript to access REST? I am using VBA from Excel, to retrieve Confluence information to display in excel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can also use GET on /rest/api/2/user/permission/search. You can specify user, projectKey and permissions you're interested in (e.g. BROWSE, CREATE_ISSUE, etc.). It works pretty well.
See Jira REST API documentation:
https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/user-findUsersWithAllPermissions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey,
can I get a list of projects where particular user has a BROWSE permission?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not easily without iterating over all projects in Jira.
I would use @Jens Knipper's solution mentioned above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I need this information for further processing. I build external powershell-based tool.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe someone is still looking for this (it is not problem to get projects from browser for you...)
But lot of users who are working with Jira Rest API is calling with admin permissions.
And with the
"rest/api/2/project/" will give them all projects.
But they need for some user.
I had try many ways but only that I can be sure that is working is this:
Something Like PseudoCode:
userproject=array();
projects="rest/api/2/project"
for( projects as project)
{
assignable="rest/api/2/user/assignable/multiProjectSearch?projectKeys="+project.key;
for(assignable as ass)
{
userproject.push(project)
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.