Hello,
I use Jira Server 7.6.3, so i try to use this api: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/user-updateUser.
I want to make user Unactive.
First i get user info via browser: JIRAURL/rest/api/2/user?username=nowakor and copied all response.
{
"self": "JIRAURL/rest/api/2/user?username=xxx",
"key": "xxx",
"name": "xxx",
"emailAddress": "xxx@gmail.com",
"avatarUrls": {
"48x48": "JIRAURL/secure/useravatar?avatarId=10122",
"24x24": "JIRAURL/secure/useravatar?size=small&avatarId=10122",
"16x16": "JIRAURL/secure/useravatar?size=xsmall&avatarId=10122",
"32x32": "JIRAURLl/secure/useravatar?size=medium&avatarId=10122"
},
"displayName": "xxx [test]",
"active": true,
"timeZone": "Europe/Warsaw",
"locale": "pl_PL",
"groups": {
"size": 1,
"items": []
},
"applicationRoles": {
"size": 1,
"items": []
},
"expand": "groups,applicationRoles"
}
After that i did this PUT request:
{
"active":false,
"displayName": "xxx test2",
"emailAddress": "xxx2@gmail.com",
"active":false,
}
Name and email has changed but active status hasn't. Do you have any solutions?
The workaround to it is in the get request expand groups and remove the user from all the groups. Especially the JIRA software users groups. With this, the user cannot login and also will not consume a license.
This is the best alternative that worked for me via script.
Let me know if you have any queries.
If this solution works for you, please accept the answer so that it will be helpful for others in the community.
Yeah, this soulution sounds really great for me especially when my mian goal is to reduce unactive users that use license.
Thanks @Arun_Thundyill_Saseendran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're welcome @Rafał Nowakowski :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
If you look at the scheme for the updateUser endpoint (request scheme) there is no mention of the active flag, which explains why you can't use it. As of now, deactivating a user through the API is not yet possible, it's tracked here: https://jira.atlassian.com/browse/JRASERVER-44801
My suggestion would be to vote for it and watch it. If you're handy with scripts, you could leverage ScriptRunner Script REST Endpoint to build your own (https://scriptrunner.adaptavist.com/latest/jira/rest-endpoints.html).
Best luck with either option!
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The https://jira.atlassian.com/browse/JRASERVER-44801 issue was fixed on Jira 8.3.0. Now you can deactivate users using the standard API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.