The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
GET /rest/usermanagement/1/search
_this.request('GET', '/search?entity-type=user&restriction=' + restriction + '&start-index=' + startIndex + '&max-results=' + maxResults + '&expand=user').
the return value like this:
[ { link:
{ href: 'http://xxxxxx:8095/crowd/rest/usermanagement/1/user?username=0202@test.com',
rel: 'self' },
name: '0202@test.com',
password: { link: [Object] },
key: '32769:3516f19a-df58-41c9-8721-0edac1f6431e',
active: true,
attributes: { attributes: [], link: [Object] },
'first-name': 'xxxx',
'last-name': 'xxxx',
'display-name': 'xxxxx',
email: '0202@test.com',
'created-date': 1486044305000,
'updated-date': 1557502165000 }]
why the attributes.attributes is empty array? do I miss something?
Hi @kamanwu
You need to add '&expand=attributes' to your request, for instance
curl -X GET -u "test:password" -H "Accept: application/json" 'http://localhost:8095/crowd/rest/usermanagement/1/search?entity-type=user&restriction=email%3Dj*&expand=user&expand=attributes'
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.
Quoting Atlassian's documentation:
You can use the
expand
query parameter to specify a comma-separated list of entities that you want expanded, identifying each of them by name. For example, appending?expand=attributes
to a users's URI requests the inclusion of the user attribute names and values in the response.
I do agree that it's not very clear that it also applies to cql searches.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I really need get the user attributes when getting a list of users (NOT just ONE user).
no one know the reason?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone! We are very excited to announce some much needed changes to the issue create experience in JSM (the blue "create" button) at the top of the screen. We have just starte...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.