• 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

            [JRASERVER-37294] Allow set active/inactive user via REST API

            WOW! I thought it will never be implemented. 5.5 years for such a simple thing...
            I know as a product owner it is hard to set priorities... So I stop complaining. 
            Thanks for doing it!!!

            Torben Hoeft added a comment - WOW! I thought it will never be implemented. 5.5 years for such a simple thing... I know as a product owner it is hard to set priorities... So I stop complaining.  Thanks for doing it!!!

            As of Jira 8.3.0, it's now possible to make users active or inactive using the REST API.

            Please refer to https://docs.atlassian.com/software/jira/docs/api/REST/8.3.0/#api/2/user-updateUser for details.

            Daniel Rauf added a comment - As of Jira 8.3.0, it's now possible to make users active or inactive using the REST API. Please refer to https://docs.atlassian.com/software/jira/docs/api/REST/8.3.0/#api/2/user-updateUser for details.

            Chris is right, this REST service should be bundled with Jira.

            A client needed this feature, then I found myself here. Anyway, we added this feature to Enhancer Plugin

            It is as simple as a Get request below:

            {JIRA_BASE_URL}/rest/jep-api/latest/user/{userkey}/deactivate
            {JIRA_BASE_URL}

            /rest/jep-api/latest/user/{userkey}/activate 

            Tuncay Senturk added a comment - Chris is right, this REST service should be bundled with Jira. A client needed this feature, then I found myself here. Anyway, we added this feature to Enhancer Plugin It is as simple as a Get request below: {JIRA_BASE_URL}/rest/jep-api/latest/user/{userkey}/deactivate {JIRA_BASE_URL} /rest/jep-api/latest/user/{userkey}/activate 

            The most exasperating thing to me is that this used to work before they forced everything to their REST API... At the time that they were moving stuff over to the new API, they were all "tell us if some feature isn't working in the new API and we'll fix it!" Apparently that wasn't the case though, since this critical feature is still missing over three years later...

             

            https://community.atlassian.com/t5/Answers-Developer-Questions/Disable-user-accounts-through-SQL-API-without-having-to-shut/qaq-p/560732

             

             

            Chris Myers added a comment - The most exasperating thing to me is that this used to work before they forced everything to their REST API... At the time that they were moving stuff over to the new API, they were all "tell us if some feature isn't working in the new API and we'll fix it!" Apparently that wasn't the case though, since this critical feature is still missing over three years later...   https://community.atlassian.com/t5/Answers-Developer-Questions/Disable-user-accounts-through-SQL-API-without-having-to-shut/qaq-p/560732    

            Is there a plan, when this really required feature will be available in Jira itself?

            We have a lot of external Users. They work for a couple of weeks/month for us. So we have to deaktivate them all manually. And this is also only possible if we disable the "Update properties from LDAP", which is also a required feature... Currently our Jira admin has a lot of work only on maintaining the user accounts. I think this should not be.

            Roger Abderhalden added a comment - Is there a plan, when this really required feature will be available in Jira itself? We have a lot of external Users. They work for a couple of weeks/month for us. So we have to deaktivate them all manually. And this is also only possible if we disable the "Update properties from LDAP", which is also a required feature... Currently our Jira admin has a lot of work only on maintaining the user accounts. I think this should not be.

            paul.wagland220683699 added a comment -

            Particularly when you are migrating from another system, it is not uncommon to have to create a large number of users, who should not be able to login, as they are no longer employees of the company. In this scenario, you want to be able to script the creation, and disabling of those users. The disabling is important for audit compliance reasons. The creation can be scripted, but the disabling cannot be.  This really should be added so that this can be easily done.

            paul.wagland220683699 added a comment - Particularly when you are migrating from another system, it is not uncommon to have to create a large number of users, who should not be able to login, as they are no longer employees of the company. In this scenario, you want to be able to script the creation, and disabling of those users. The disabling is important for audit compliance reasons. The creation can be scripted, but the disabling cannot be.  This really should be added so that this can be easily done.

            I just got an email from Atlassian saying that licensing renewal cost is going to be jumping by 10%. I'm so thrilled to find out about the "increased investment in [their] server products" that sparked said monstrous jump, especially when I remember stuff like this.

            Chris Myers added a comment - I just got an email from Atlassian saying that licensing renewal cost is going to be jumping by 10%. I'm so thrilled to find out about the "increased investment in [their] server products" that sparked said monstrous jump, especially when I remember stuff like this.

            That's all great, and I'm glad that there's a plugin for it, but from my perspective, why should we spend nearly as much on a plugin as we do for the product itself, to do something that should be natively included in the product directly?

            Chris Myers added a comment - That's all great, and I'm glad that there's a plugin for it, but from my perspective, why should we spend nearly as much on a plugin as we do for the product itself, to do something that should be natively included in the product directly?

            Adam Labus added a comment -

            Hello,

            if you are looking ability to active/deactive users using REST API please check my new plugin Extender for JIRA

             

            Cheers

            Adam Labus added a comment - Hello, if you are looking ability to active/deactive users using REST API please check my new plugin  Extender for JIRA   Cheers

            Bruce Dang added a comment - - edited

            Hello all,

            Is there something new for this function ?

            Regards.
            Bruce Dang

            Bruce Dang added a comment - - edited Hello all, Is there something new for this function ? Regards. Bruce Dang

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

                Created:
                Updated:
                Resolved: