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

Update multi-user picker field via REST API V3 does not support accountId

      Summary

      Editing a multi-user picker field for an issue via */rest/api/3/issue/

      {issueId}* does not work when using accountId.

      h3. Steps to Reproduce
      # Make a PUT request to */rest/api/3/issue/{issueId}

      * containing the following JSON body where custom field ID is for a multi-user picker type field:

      {
          "fields": {
              "customfield_10055": [
                  {
                      "accountId": "0f0000fff0ffff0f0000f00f"
                  }
              ]
          }
      }
      
      1. Get HTTP response code 204.
      2. Check the issue in the Jira UI.

      Expected Results

      The multi-user picker custom field has been updated to include the specified user.

      Actual Results

      No values have been added to the multi-user custom field.

      Notes

      accountId is working for single user picker custom field type.

      Workaround

      Currently the name parameter is supported, this would be the username of the user you wish to add like below:

      {
          "fields": {
              "customfield_10055": [
                  {
                      "name": "admin"
                  }
              ]
          }
      }
      

            [JRACLOUD-72000] Update multi-user picker field via REST API V3 does not support accountId

            Dmitry Pashkevich added a comment - - edited

            I just tried this API, and looks like:

            • Specifying user id now works
            • Specifying username *no longer works* but used to work (although the PUT request still returns a 204, but the custom field value is set to null)

             

            Example requests:

            1. Using user id (works)

            curl --location --request PUT 'https://{{base_url}}/rest/api/3/issue/{{issue_key}}' \
            --header 'Authorization: Basic {{token}}' \
            --header 'Content-Type: text/plain' \
            --data-raw '{
              "fields": {
                "customfield_123": [
                    {
                        "id": "<user id, like 5c508a2281ec9e450ceb0f9e>"
                    }
                ]
              }
            }' 

            2. User user name (doesn't work) - as documented

            curl --location --request PUT 'https://{{base_url}}/rest/api/3/issue/{{issue_key}}' \
            --header 'Authorization: Basic {{token}}' \
            --header 'Content-Type: text/plain' \
            --data-raw '{
              "fields": {
                "customfield_123": [
                    {
                        "name": "<username, like d.pashkevich>"
                    }
                ]
              }
            }'

             

            Dmitry Pashkevich added a comment - - edited I just tried this API, and looks like: Specifying user id now works Specifying username * no longer works * but used to work (although the PUT request still returns a 204, but the custom field value is set to null )   Example requests: 1. Using user id (works) curl --location --request PUT 'https: //{{base_url}}/ rest /api/3/issue/{{issue_key}}' \ --header 'Authorization: Basic {{token}}' \ --header 'Content-Type: text/plain' \ --data-raw '{ "fields" : { "customfield_123" : [ { "id" : "<user id, like 5c508a2281ec9e450ceb0f9e>" } ] } }' 2. User user name (doesn't work) - as documented curl --location --request PUT 'https: //{{base_url}}/ rest /api/3/issue/{{issue_key}}' \ --header 'Authorization: Basic {{token}}' \ --header 'Content-Type: text/plain' \ --data-raw '{ "fields" : { "customfield_123" : [ { "name" : "<username, like d.pashkevich>" } ] } }'  

            Hi vasanta.kumaar. You would need to look up their email address using user search to find the account ID, and then you can use the account ID to create/update the issue.

            Ben Kelley added a comment - Hi vasanta.kumaar . You would need to look up their email address using user search to find the account ID, and then you can use the account ID to create/update the issue.

            Hi Ben Kelly,

             

            Is there a way to update multi user picker field using user mail ID. If yes can you provide me the workaround.

             

            Thanks,

            Vasanta

            Vasanta Kumaar added a comment - Hi Ben Kelly,   Is there a way to update multi user picker field using user mail ID. If yes can you provide me the workaround.   Thanks, Vasanta

            Hi e8a34a83eca6. This issue was resolved some time ago. I wonder if maybe you are experiencing a different issue.

            Ben Kelley added a comment - Hi e8a34a83eca6 . This issue was resolved some time ago. I wonder if maybe you are experiencing a different issue.

            kjd86791 added a comment - - edited

            experience same issue, id nor name does not works. But code response code : 400

            kjd86791 added a comment - - edited experience same issue, id nor name does not works. But code response code : 400

            Fields specified by an "ID" type use the attribute "id". For system user fields (only) we allow "accountid" as a synonym. For custom user fields you need to use "id", like:

            {
                "fields": {
                    "customfield_10055": [
                        {
                            "id": "0f0000fff0ffff0f0000f00f"
                        }
                    ]
                }
            } 

            Ben Kelley added a comment - Fields specified by an "ID" type use the attribute "id". For system user fields (only) we allow "accountid" as a synonym. For custom user fields you need to use "id", like: { "fields" : { "customfield_10055" : [ { "id" : "0f0000fff0ffff0f0000f00f" } ] } }

            Workaround does not work for gdpr migrated apps, so it is not possible to update multi-user picker fields at all.

            Vladimir Dubovik added a comment - Workaround does not work for gdpr migrated apps, so it is not possible to update multi-user picker fields at all.

              bkelley@atlassian.com Ben Kelley
              nwolfgang Battlebeard (Inactive)
              Affected customers:
              2 This affects my team
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: