Hello everybody,
i want to list people who have rights in a certrain JIRA Project.
the problem is the REST API shows more user who have authorization, than the JIRA Project itself has.
So the REST API lists more user, than the JIRA project has.
How can i fix this?
thanks in advance
Hi,
Can you specify the REST API you tried?
How many people the REST API returned and how many there are actually accoriding to Jira?
With the following API call we get users for the specfied role (in this case e.g. 10301). The most of them are also visible in JIRA itself, but some of the users in the API result do not exist in JIRA, only in the API call. These users used to exist, but are not longer in our company and therefore not longer in JIRA, but somehow the API returns them anyway.
https://JIRA_INSTANZ/rest/api/2/project/PROJECT_KEY/role/10301
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now i understand your issue :)
Yes, Jira keeps all the users that ever exists (even if they left the company).
Users that left the company (if no one manually delete from Jira) become "not active" in Jira.
So if you want to list only the active people you need to this.
In step 2 you get the details of the user, and there the API tells you if the user is active or not.
So if he is active, keep it in your list of users, if he is not active remove it from your list.
Finally you will have a list for only all the active users (which is what you wanted)
Cheers,
Nir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your answer Nir
But this doesnt solve the problem.
When I go to project settings, then in the submenu "Users and roles".
The user who is shown in the REST API is not assigned any role.
We tested it by adding a random user in that role and then remove him again. And it worked fine.
First the user was shown in the REST API then after removing him, he was gone.
That worked fine.
But some users in particular, always stays in the REST API in that project, altough they arent listed in the projects users and roles.
We used to have more JIRA instances, then migrated all to one. Can that be the problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my case, there are users in a role and groups in a role.
So maybe the users you don't want to see are hiding in groups?
I don't think the migration is the reason, it doesn't matter where you brought you data from, the API just show you data, that means the users are listed in the Jira (even if they are not supposed to).
When are trying to run the REST API i suggested in step 2, all of the users are "active"?
You should see all erelevent users as "not active"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The users are not in Groups. For test purposes we deleted all users/groups from the example role (10301), so that JIRA doesn't show any users or groups for this role now. But the API still shows this one particular user.
The problem why we can't just show the active is, that there can be inactive users which are still related to a role in a project and we want our project leads to remove them. So we have to show the project leads any users which are currently related to the roles in their projects no matter of the users are active or inactive. For almost any inactive users this works fine (so jira normally shows the inactive users under "User and roles".
You can see the problem in the Screenshots below
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.
Hi,
I have the same problem: one specific user who even doesn't exists in the Jira user database anymore, is returned in the result of a call to the REST API "rest/api/2/project/<project key>/role/10301" but not shown on the "Users and roles" page of the 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.