I manage a large JIRA instance that reguarly needs to have users removed as employees come and go.
I can source employee information from our HR system.
I need to compare these to JIRA users and where a JIRA user exists, but not in our HR system, update the JIRA user so that they are move to a leavers JIRA group (without deleting the user).
Is there a method in the JIRA API to retrieve a list of users? Previously I've done this by querying the JIRA database user table directly. It seems more elegant to do this via the API. I would then compare the list of users with their data in the HR system and only modify the JIRA users who have left. Much more efficient than checking every user in JIRA and HR.
JIRA Command Line Interface has various user functions, specifically getUserList for a group. This corresponds to a SOAP capability. If all your active users are in jira-users then that would work. Otherwise, I don't know of a simple way to list all users via SOAP. I think the REST APIs are similarly lacking in this area currently.
Here's what I did:
got the users from the JIRA database directly by doing
select username from userbase
this created a list, which I cycled through looking for usernames in JIRA and comparing them to my HR system.
then logged into JIRA using SOAP and removed them from the jira-user group and added them into a jira-leavers group.
I'm now working on zapping their project roles too.
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.