Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-85060

Searching for users with a certain property via REST API returns empty or unexpected results

XMLWordPrintable

      Issue Summary :

      Searching for users with a certain property via REST API returns empty string.

      Environment

      Jira Cloud

      Steps to Reproduce

      1) Set a custom property for a user via Set user property (PUT)
      Use a body like this to define the property:

      {"PropertyKey":"PropertyValue"}  

      2) Confirm that the property was correctly set:

      <sitename>.atlassian.net/rest/api/3/user/properties/<property-name>?accountId=<the Atlassian Account ID>
      

      3) Search for all users with that property via Find users (GET)

      <sitename>.atlassian.net/rest/api/3/user/search?property=<propertyname>.value=true
      

      Expected Results

      All users with that property will be returned

      Actual Results

      Inconsistent results are retrieved, sometimes only one user comes up, and sometimes it returns an empty string ([])

      Workaround

      Try this instead:

      <sitename>.atlassian.net/rest/api/3/user/search/query?query=[PropertyName].PropertyKey is "PropertyValue"

      PropertyName refers to the name you gave to the specific property

      PropertyKey and PropertyValue refer to the payload you sent during the call to set the property in this format:

      {"PropertyKey":"PropertyValue"} 

      For reference:
      https://community.developer.atlassian.com/t/jira-cloud-api-searching-for-users-who-have-a-specific-user-property-set-via-the-api/38885/13
      https://community.developer.atlassian.com/t/uql-searching-users-with-defined-property/10864/2

       

              Unassigned Unassigned
              c125eb31dcc4 Danish Magrey
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: