Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-37294

Allow set active/inactive user via REST API

XMLWordPrintable

    • 69
    • 19
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      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:

      1. Go to User Management -> JIRA User Server
      2. 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)
      3. 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

              tkanafa Tomasz Kanafa
              takindele Taiwo Akindele (Inactive)
              Votes:
              156 Vote for this issue
              Watchers:
              102 Start watching this issue

                Created:
                Updated:
                Resolved: