Hi!
I am trying to build a bulk user deprovision script for our Jira platform using the REST API and python.
The current manual process is for the Tech Support team to select 'Remove User' when on the user's profile in the admin Administrator settings (see below screenshot).
I have tried the API recommended here: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-delete - but it doesn't seem to get a response from the server.
I also tried: https://developer.atlassian.com/cloud/admin/user-management/rest/api-group-users/#api-users-account-id-manage-lifecycle-disable-post but this may be depricated as I receive an auth issue.
Any ideas on the best API to use for removing site access in this way specifically?
Being able to remove users from the groups they are in would also be useful but the option here doesn'ty return any response from the cloud/server either: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-groups/#api-rest-api-3-group-user-delete
I'm using Python so any advice in that langauge would be prefferred :)
Many thanks in advance!
Mike
Hi @Michael Savedra ,
based on the Atlassian Access Rest API doc, it seems that you are able to deactivate user through the following api https://developer.atlassian.com/cloud/admin/user-management/rest/api-group-users/#api-users-account-id-manage-lifecycle-disable-post
Could you try it?
Hope this helps,
Fabio
Hi @Fabio Racobaldo _Catworkx_ ,
Thanks for getting back.
This was the example that was giving me an authentication error. I thought this method may be depricated as the auth section is not in the same format as the usual REST API calls that specify "auth:" and require the JIRA account email and API token.
This only asks for the following: " headers = { "Content-Type": "application/json", "Authorization": "Bearer <access_token>" }"
Could you please specify how the auth details shoudl be formatted in this example?
Many thanks,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need an API token first to use that API. Please take a look here https://support.atlassian.com/organization-administration/docs/manage-an-organization-with-the-admin-apis/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Fabio Racobaldo _Catworkx_ ,
So I have an API token already and this works for all other API calls.
For example when I need to return the accountID for a user I will use the following:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Fabio Racobaldo _Catworkx_ I think I've spotted where I was going wrong, the options to diabel a user that you sent over asks for an 'access toke' which turns out is something different to an API token.
After looking into how I can get one of these here: https://developer.atlassian.com/platform/marketplace/knowledge-base/access-tokens-overview/ I've found you need to be a marketplace admin for that, which I'm not.
I therefore still need to find a way to use the REST API to remove/disable users rather than this method that requires an access token.
Let me know if you can help.
thanks,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In order to be able to work at user level, you need to be a Site Admin. If you're not a Site Admin, you can't do that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Fabio Racobaldo _Catworkx_ I am a site admin.
When I use the api in Python from the 'disable user' section it keeps giving me a 401 authorization error though.
EG:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.