Custom field context endpoint does not return project-scoped fields

XMLWordPrintable

    Issue Summary

    When performing a request for the Get custom field context using the fieldId parameter with a custom field that contains scope, the REST API response returns an error that the custom field was not found.

    Steps to Reproduce

    1. Access a Team managed project, and go to the project settings.
    2. Go to the issue type, and create a custom field (which will have the scope of the project).
    3. Find the custom field with the following endpoint: Get fields.
    4. Search for the custom field context using the fieldId with the ID of the custom field that was created and has the scope: Get custom field context.

    Expected Results

    The context result.

    Actual Results

    The below response is returned:

    {
    	"errorMessages": [
    		"The custom field was not found."
    	],
    	"errors": {}
    } 

    Workaround

    Currently contexts for Team managed project are not exposed to users. 

    But if you are after the option values for a field it can be retrieved using the issue create meta endpoints, referring to the field's allowedValues:

    Example:

    {   
      "required": false,
      "schema": {
        "type": "option",
        "custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
        "customId": 10074
      },
      "name": "option",
      "key": "customfield_10074",
      "hasDefaultValue": false,
      "operations": [
        "set"
      ],
      "allowedValues": [
        {
          "self": "<site>/rest/api/3/customFieldOption/10042",
          "value": "Option 1",
          "id": "10042"
        }
      ],
      "fieldId": "customfield_10074"
    }

            Assignee:
            Carol Low
            Reporter:
            Guilherme Bueno (Inactive)
            Votes:
            14 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: