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

When updating assignee via "Edit Issue" REST API endpoint, and assignee field not on the issue type's Edit screen, site still returns HTTP 204 success response instead of 400 error

XMLWordPrintable

      Issue Summary

      When the Assignee field is not included on the Edit screen for a given Issue Type, if you attempt to set the assignee for that issue via the API endpoint "/rest/api/3/issue/EX-1234", it will fail to update the issue. However, the API will still return a 204 success response, making it unclear whether there was a problem or not.

      According to the API documentation for this endpoint, the response should be a 400 indicating the field is not able to be edited.

      400 Bad Request

      Returned if:

      • the request body is missing.
      • the user does not have the necessary permission to edit one or more fields.
      • the request includes one or more fields that are not found or are not associated with the issue's edit screen.
      • the request includes an invalid transition.

      This has been tested with various other system and custom fields, and all returned the expected 400 error if the field was absent from the Edit screen. This behavior has only been reproducible with the "Assignee" field.


      This is reproducible on Data Center: unknown

      Steps to Reproduce

      1. Remove "Assignee" field from the "Edit" screen on an issue type
      2. Send the following payload to an issue using the same issue type:
        "fields":{
        	"assignee": {
        		"id": "USER_ID_HERE"
        		}
        	}
        }
        

      Expected Results

      Error 400 returned with message "Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown."

      Actual Results

      Success 204 returned with empty response.

      Workaround

      Ensuring the Assignee field is present on the Edit screen of the issue type before submitting the API call should allow the request to actually succeed.

      Alternatively, there is a dedicated endpoint for assigning issues., which will allow updating the assignee of the issue irrespective of the field's presence on the Edit screen. Documentation for this endpoint
      https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-assignee-put

      For example, you would submit the following payload to the endpoint https://your-site.atlassian.net//rest/api/3/issue/EX-1234/assignee

      { "accountId": "USER_ID_HERE" }
      

            Unassigned Unassigned
            01064d408fbc Ryan A (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: