Hello.
I have a python script that I use to deactivate users periodically.
Suddenly it stops to work, I still can get a list of all the registered users but when I try to deactivate any of them I got the following message:
Error Deactivating USERNAME: JiraError HTTP 401 url: https://my_url/admin/rest/um/1/user/deactivate?username=USERNAME
text: User failed to authenticate
I am a administrator, I was using email/password but even when changed to email/token I got the same error.
The script is simple like that:
jira = JIRA(basic_auth=(atlassianEmail, atlassianToken),
#options={'server': 'https://my_url'})
jira.deactivate_user(USERNAME)
Do anyone have any ideas?
I am able to disable user using below rest API.
you need to generate API @https://admin.atlassian.com/ -> settings
In order to manage user users, you have to verify your domain.
let's say your users contain email = user@test.com, you need to verify the test.com domain.
domain verification steps:
https://admin.atlassian.com/ -> directory->domains
you can disable /delete user from https://admin.atlassian.com/ ->directory->usermanagement
sample request
curl --request POST \ --url 'https://api.atlassian.com/users/<user_id>/manage/lifecycle/disable' \ --header 'Authorization: Bearer XXXXX' \ --header 'Content-Type: application/json' \ --data '{ "message": "On 6-month suspension"}'
this should be user id:<user_id>
Authorization: Bearer XXXXX .
XXXXX = APi key
I am able to disable user using below rest API.
you need to generate API @https://admin.atlassian.com/ -> settings
In order to manage user users, you have to verify your domain.
let's say your users contain email = user@test.com, you need to verify the test.com domain.
domain verification steps:
https://admin.atlassian.com/ -> directory->domains
you can disable /delete user from https://admin.atlassian.com/ ->directory->usermanagement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sample request
curl --request POST \ --url 'https://api.atlassian.com/users/<user_id>/manage/lifecycle/disable' \ --header 'Authorization: Bearer XXXXX' \ --header 'Content-Type: application/json' \ --data '{ "message": "On 6-month suspension"}'
this should be user id:<user_id>
Authorization: Bearer XXXXX .
XXXXX = APi key
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.