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

Is there an API to search Crowd by properties/attributes?

Patrick Lightbody August 30, 2011

Related to this question, an alternative way I might solve the problem is to store a new unique username as an attribute on the Crowd user. However, it's not clear looking at the REST API that I can search by property key/value pairs. For example, I currently can search for username or email like so:

TermRestriction<String> byEmail = new TermRestriction<String>(UserTermKeys.EMAIL, email);
TermRestriction<String> byUsername = new TermRestriction<String>(UserTermKeys.USERNAME, username);
SearchRestriction search = new BooleanRestrictionImpl(BooleanRestriction.BooleanLogic.OR, byEmail, byUsername);
List<User> users = crowdClient.searchUsers(search, 0, 10);

The question is: can I search by user attribute instead?

Thanks!

Patrick

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Andrey Larionov
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.
September 5, 2011

As i can find, there are com.atlassian.crowd.search.query.entity.restriction.constants.AliasTermKeys in crowd-api-2.2.8 at least. Comments says what this Term respond for users aliases. There is also public interface com.atlassian.crowd.manager.application.AliasManager.

But as i understand it will actually work only in Crowd, not in EmbededCrowd.

Patrick Lightbody September 5, 2011

What do you mean when you say "Crowd" or "EmbeddedCrowd"? I'm looking for something that will let me make remote queries using the REST or SOAP API. Those interfaces look like they would require a Crowd plugin, yes?

Andrey Larionov
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.
September 5, 2011

Also i think your could expose needed logic by writing your own REST plugin for crowd

Andrey Larionov
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.
September 5, 2011

Since JIRA 4.3 it has embedded crowd for user management.

But looking deep in source of Crowd i can say what Alias search is not exposed in remote API. According to http://confluence.atlassian.com/display/CROWDDEV/Crowd+Query+Language it's not possible.

I think you could raise issue in support tracker

TAGS
AUG Leaders

Atlassian Community Events