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
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.
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)
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?
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"
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
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event