Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,119
Community Members
 
Community Events
168
Community Groups

Scriptrunner for Confluence - Get unsynced users

Hello,

I know that it's possible to get the deactivated users in Confluence with userAccessor.isDeactivated(user).

But is there a way to get also the users which are unsynced from directory via Scriptrunner?

Best regards,
Michael

1 answer

0 votes

This is possibly using Atlassian's PersonService API. Here's an example script for the Script Console that gets all the unsynced users and lists their display names:

import com.atlassian.confluence.api.model.pagination.SimplePageRequest
import com.atlassian.confluence.api.service.people.PersonService
import com.onresolve.scriptrunner.runner.ScriptRunnerImpl

def personService = ScriptRunnerImpl.scriptRunner.getService(PersonService)
personService.search().forUnsyncedUsers('').fetchMany(new SimplePageRequest(0, 100)).results.collect { person ->
person.displayName
}

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events