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

REST API SearchRestriction findAllGroups

Brian E. Nicely June 24, 2011

I'm trying to convert my Java code from using the SOAP integration libraries to using the REST libraries.

Using the SOAP libraries, I was able to find all groups with no problem, but now that I'm using the REST libraries, I can't find an easy way to find all the groups.

Here is an example of what I'm currently doing but there surely has to be a better way.

SearchRestriction searchRestriction = Combine.anyOf(Restriction.on(GroupTermKeys.NAME).startingWith("a"),Restriction.on(GroupTermKeys.NAME).startingWith("b")...);

Can anyone help me out here?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Brian E. Nicely June 26, 2011

I figured out a kludge solution for my search restriction:

SearchRestriction searchRestriction = Combine.anyOf(Restriction.on(GroupTermKeys.ACTIVE).exactlyMatching(true),Restriction.on(GroupTermKeys.ACTIVE).exactlyMatching(false));

Since the active flag can only be true or false, this will get me every group.

I really wish there was an easier way to just get all the groups, but at least I have a work around for now.

1 vote
twong_atlassian
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.
June 24, 2011

Not sure if this is exactly what you want, if you're using rest resources, you can get a listing of all groups by hitting this:

http://YOURDOMAIN:8095/crowd/rest/usermanagement/latest/search?entity-type=group&restriction=name%3D*

I sadly, have never played with the actual REST libraries... i just toy with the interfaces from time to time.

Hoping someone who's more knowledgable about the libraries will chime in.

Bob Swift (personal)
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.
June 24, 2011
I had a similar question that I commented on here: https://jira.atlassian.com/browse/CWD-1912?focusedCommentId=236266&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-236266without any response. The new Crowd apis do not support the same things capabilities as before :(.
Brian E. Nicely June 26, 2011

I might end up actually using the REST URLs to access the the REST service versus using the REST integration Java libraries since what you posted Tim actually gives me what I want.

I have to agree with Bob, the new APIs are completely different. Not that it's totally a bad thing, but some basic functionality has been removed. Any idea on why it was removed and when it might come back?

TAGS
AUG Leaders

Atlassian Community Events