Uploaded image for project: 'Atlassian Intelligence'
  1. Atlassian Intelligence
  2. AI-285

Conflunce cloud search user rest api doesn't work for guest-users

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Search - Indexing
    • None
    • Severity 3 - Minor

      Issue Summary

      When I use CQL in REST API for searching users endpoint and the user is a guest, the endpoint does not return the data for guests.

      When I don’t use CQL in REST API endpoints and user is a guest, the endpoint return data for all users including guests.

      Steps to Reproduce

      1. Request https://{site}/wiki/rest/api/search/user?cql=user in ("{accountId}")  with cql query
      2. See the response - it's empty, like this:
      {
      2	"results": [],
      3	"start": 0,
      4	"limit": 25,
      5	"size": 0,
      6	"totalSize": 0,
      7	"cqlQuery": "user in (\"5e6ab05fae59460cfb01ff8a\")",
      8	"searchDuration": 192,
      9	"_links": {
      10		"base": "https://msztuba-test.atlassian.net/wiki",
      11		"context": "/wiki"
      12	}
      13}
      1. Request https://{site}/wiki/rest/api/user?accountId={accountId} without cql query
      2. See the response - it contains data.
      {
      2	"type": "known",
      3	"accountId": "{accountId}",
      4	"accountType": "atlassian",
      5	"email": "",
      6	"publicName": "",
      7	"profilePicture": {
      8		"path": "/wiki/aa-avatar/5e6ab05fae59460cfb01ff8a",
      9		"width": 48,
      10		"height": 48,
      11		"isDefault": false
      12	},
      13	"displayName": "",
      14	"isExternalCollaborator": false,
      15	"_expandable": {
      16		"operations": "",
      17		"personalSpace": ""
      18	},
      19	"_links": {
      20		"self": "https://{site}/wiki/rest/api/user?accountId=5e6ab05fae59460cfb01ff8a",
      21		"base": "https://{site}/wiki",
      22		"context": "/wiki"
      23	}
      24}

      Expected Results

      Both endpoints (with cql and without) should return the same data. 

      Actual Results

      As above

      ...
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            [AI-285] Conflunce cloud search user rest api doesn't work for guest-users

            c104318e957e 7659915ce41f it looks like we may need to have some documentation updated. Try adding request parameter sitePermissionTypeFilter=externalCollaborator, looks like we have documentation for this parameter on https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search/#api-wiki-rest-api-search-get, but not https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search/#api-wiki-rest-api-search-user-get.

            sitePermissionTypeFilter string
             
            Filters users by permission type. Use NONE to default to licensed users, EXTERNALCOLLABORATOR for external/guest users, and ALL to include all permission types.

            Default: none
            Valid values: allexternalCollaboratornone

            Casey Stehlik added a comment - c104318e957e 7659915ce41f it looks like we may need to have some documentation updated. Try adding request parameter sitePermissionTypeFilter=externalCollaborator , looks like we have documentation for this parameter on https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search/#api-wiki-rest-api-search-get, but not https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search/#api-wiki-rest-api-search-user-get . sitePermissionTypeFilter string   Filters users by permission type. Use NONE to default to licensed users, EXTERNALCOLLABORATOR for external/guest users, and ALL to include all permission types. Default:  none Valid values:  all ,  externalCollaborator ,  none

            I can confirm that in our instance the search API still doesn't work for guest users. Please share the details of the fix, if possible, so we can figure out how to handle this type of users in the future.

            Yuri Kleshchenok added a comment - I can confirm that in our instance the search API still doesn't work for guest users. Please share the details of the fix, if possible, so we can figure out how to handle this type of users in the future.

            Lawrence Chou added a comment - - edited

            Guest Users are still missing from Search Users API responses, with or without the `accountId` filter. @Ying Wang do you mind sharing more detail about the fix? Thank you!

             

            P.s. Neither the MDS-1456 nor the commit tracker for `cb246c8dfca2302345c471a2661452e43f728c74` seems to be accessible publically.

            Lawrence Chou added a comment - - edited Guest Users are still missing from Search Users API responses, with or without the `accountId` filter. @Ying Wang do you mind sharing more detail about the fix? Thank you!   P.s. Neither the MDS-1456 nor the commit tracker for `cb246c8dfca2302345c471a2661452e43f728c74` seems to be accessible publically.

            Ying Wang added a comment - The fix is already in prod https://commit-tracker-ux-react.us-east-1.staging.public.atl-paas.net/?option=hash&repo=confluence&hash=cb246c8dfca2302345c471a2661452e43f728c74

            Morgan Wang added a comment - Our team is investigating this. Work is being tracked here: https://atl-growth.atlassian.net/browse/MDS-1456?atlOrigin=eyJpIjoiZmM0OWU3NTI0ODU5NGI5N2JiYTBlOGUwMmYxNWE0ZDIiLCJwIjoiamlyYS1zbGFjay1pbnQifQ

              ywang2@atlassian.com Ying Wang
              61fc5024cfea Mirek Sztuba (Inactive)
              Affected customers:
              11 This affects my team
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: