-
Bug
-
Resolution: Fixed
-
Low
-
3.10.0
-
None
-
None
Let's assume that you have following Crucible project settings:
Allowed reviewers:
- users: allowed_user
- groups: allowed_grup (with user: user_of_allowed_group)
When you use search box to add a reviewer, you want to see specific result items for the phrase: "allowed"
- you expect to see the result: allowed_user, allowed_group, user_of_allowed_group
- you can see items for any user from allowed user list (here: allowed_user)
- you can see items for any user being a member of allowed groups (here: user_of_allowed_group)
- but you can't see an item for a group itself (here: allowed_group), so there is not option to click for the group item and add all members
The source of this problem is in the broken logic inside ReviewerFinderAjaxAction#getAllowedActiveReviewers, which provides final data populated to the ajax response.
List<ReviewerData> allowed = new ArrayList<>(); if (getReview() != null) { // first we try to collect all allowed users and all members of allowed groups // note that getAllowedRevierwers() returns flattened list of allowed users and members of allowed groups allowed.addAll(ImmutableList.copyOf(Iterables.transform(filter(getReview().getProject().getAllowedReviewers(), prefix, true), UserOrGroup.fromUserFunction))); } // so if there is no allowed user/group... if (allowed.isEmpty()) { // ... we perform global search and we allow users and groups to be returned allowed.addAll(getActiveUsersAndCurrentReviewers(prefix)); } Collections.sort(allowed); return allowed;
You can look at the rest of this class here: https://fisheye.dev.internal.atlassian.com/browse/FE-git/src/java/com/atlassian/crucible/actions/search/ajax/ReviewerFinderAjaxAction.java?r1=6ef375d16e137256ad58eaaa6d7d3de8a4b2bd10&r2=6ef375d16e137256ad58eaaa6d7d3de8a4b2bd10&u=20