Hi.
In one of my projects the client would like the ability to, when creating a new Jira user, to set them as inactive by default, and I'd like to know if that is possible and how.
Checking UserService and ApplicationUser, I can see that I can check if a user is active, but not actually manipulate the user's activity status.
Please advise, thank you!
If you're creating a new user via the API, you can set them as active, or not, when the record is created.
If you're talking about disabling users that are created via any mechanism (like a directory sync), what might be easiest is to create the user as usual, but don't give them application access by default.
It's the latter. Client has their internal employee system, where, when a new employee is added, they want the synchronizer plugin to automatically create a new Jira user. Which is currently implemented and works.
They just want to make it now that, when that new user is created, it is set to inactive.
User creation is handled through a service class that makes use of UserManager and UserService,
I can see that you can use method withNoApplicationAccess() to deny application access on user creation, but that wouldn't necessarily make the user inactive, right?
I suppose in that case implementing an update user API call is the most straightforward way?
I was hoping for something roundabout.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can refer to Adaptavist Libaray and their complete code examples: Deactivate Users.
I will try to provide you with some examples of creating users with inactive status by default later.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here some extended code by Adaptavist:
final Long directoryId = 1
Users.create('bob', 'bob@mail.com', 'Mr Bob') {
setDirectoryId(directoryId)
setPassword('secret')
withNoApplicationAccess()
}.deactivate()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline 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.