Uploaded image for project: 'JIRA Server (including JIRA Core)'
  1. JIRA Server (including JIRA Core)
  2. JRASERVER-37294

Allow set active/inactive via REST API

    XMLWordPrintable

    Details

    • Feedback Policy:
      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 An updated workflow for server feature suggestions.
    • UIS:
      121

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                takindele Taiwo Akindele
              • Votes:
                148 Vote for this issue
                Watchers:
                92 Start watching this issue

                Dates

                • Created:
                  Updated: