The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set a User from Inactive to Active with Scriptrunner/Groovy

Sngy
October 22, 2020

Hello,

I want to set a user in the user management of jira from "inactive" to "active".

How can i realize this with code? I only found similiar questions, which are about deactivating a user after a period of time.

Thanks in advance!

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 22, 2020

See https://library.adaptavist.com/entity/deactivate-users

You just need to amend some of the wording that's in the messages, and change the "false" to "true" in the line that sets the active/inactive flag

ChandraPrakash
October 5, 2022

Hello,

Can you suggest the script for confluence where we can activate users.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 5, 2022

Have a look at the library script - there's a line that deactivates a user with a function call to deactivate the user.  Change the call to activate instead.

0 votes
April
Contributor
June 14, 2024

In case anyone else is looking for a solution, "activate" got moved to a different class DisabledUserManager, which has an enableUser() method.

Of course, there's a Library example for this. 

Thanks ScriptRunner :)