-
Suggestion
-
Resolution: Fixed
-
69
-
19
-
NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.
Summary
Currently it appears the /rest/api/2/user (PUT) API doesn't provide facility to set users active or inactive, or perhaps the request representation doesn't include how this is done. Currently the API works fine for the following fields:
{ "name": "eddie", "emailAddress": "eddie@atlassian.com", "displayName": "Eddie of Atlassian" }
Can something like "Active": 1 or "Active": true be made available for this API as well to set the Activate or de-activate a user?
Workaround
Use Crowd REST API following these steps:
- Go to User Management -> JIRA User Server
- Create a new one with the below details (you can use your own values):
- Application Name: app_name
- Password: app_pwd
- IP Addresses: Insert the IP/s (each on a separate line) of the client from where the subsequent REST call is to be run (to whitelist it so that the REST call is allowed to run)
- Test with this command:
- If Linux:
curl -D- -u app_name:app_pwd -X PUT --data '{"name":"anyUsername", "active":"false"}' <jira-url>/rest/usermanagement/1/user?username=anyUsername -H 'Content-Type: application/json' -H 'Accept: application/json'
- If Windows:
curl -D- -u app_name:app_pwd -X PUT --data "{\"name\":\"anyUsername\", \"active\":\"false\"}" <jira-url>/rest/usermanagement/1/user?username=anyUsername -H "Content-Type: application/json" -H "Accept: application/json"
Use the right username (anyUsername - 2 occurences) and replace <jira-url> with actual JIRA URL
- If Linux:
- derived from
-
JRASERVER-27782 REST API for user administration
- Closed
- is duplicated by
-
JRASERVER-36639 Cannot update the property "active" in the JIRA REST api
- Closed
-
JRASERVER-44801 JIRA API disabling users
- Closed
- relates to
-
ID-164 JIRA User Management REST API
- Closed
-
ID-8461 Allow set active/inactive via REST API
- Gathering Interest