Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

usermanagement search user by cql. return user object without attributes

I use this API 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?

2 answers

1 accepted

0 votes
Answer accepted
Bruno Vincent
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 Leaders.
May 23, 2019

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'

it works.  I just cannot find this info in the API documents.

Thank you.

Bruno Vincent
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 Leaders.
May 27, 2019

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.

I really need get the user attributes when getting a list of users (NOT just ONE user).

no one know the reason?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events