Hi @Fernando André ,
you can follow Atlassian documentation to disable a user with the API : https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-lifecycle-disable-post
Let me know if this helps,
--Alexis
Hello,
That's for the Cloud Jira, I'm using Server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Fernando André ,
this is the Server documentation : https://docs.atlassian.com/software/jira/docs/api/REST/8.3.0/#api/2/user-removeUser
Keep in mind that this features is only available from Jira 8.3.0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, unfortunately I'm still a bit behind. Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alexis Robert ,
I need your help as am new to JIRA Cloud.
Could you please explain the step-by-step process that how to disable bulk users via the API?
Regards,
Prasad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Running a Jira Server 8.13.6 I implemented a script that Disables the user, the script works fine, the commands get the responses OK and the "Active" state of the user is changed - every thing is fine there.
The strange thing is that when attempting to edit the Details of the User in the GUI - the "Deactivated Checkbox" is not ticked!
The user is inactive, and is not able to log in.
Appears to be a bug in the GUI? Will post question in forum also.
RTFM: Everything works as expected - it says "Active" not "Deactivated"....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is my python code to do it:
import urllib3
import requests
import json
from requests.auth import HTTPBasicAuth
url = f"https://yourdomain.com/rest/api/2/user"
auth = HTTPBasicAuth("user", "password")
headers = {"Accept": "application/json", "Content-Type": "application/json"}
params = {"username": "jack"}
payload = json.dumps( {"active": False} )
requests.request("PUT", url, data=payload, params=params, headers=headers, auth=auth, verify=False)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Rafael Costa
I spent a while toying with jira python library - but that got me no where. Your example worked perfectly for me on Jira Data Center 8.20.
Appreciate it.
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.