Hello,
What is the process to disable a user via the API?
Thank you.
Best regards,
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
That's for the Cloud Jira, I'm using Server.
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
Ok, unfortunately I'm still a bit behind. Thank you
this is my python code to do it:
import urllib3import requestsimport jsonfrom requests.auth import HTTPBasicAuthurl = 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)
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.
It looks like you're new here. Sign in or register to get started.