Open Context Protocol is live! 🚀 Read the launch post
getContextsForField

getContextsForField

Get custom field contexts

Details

  • Method: GET
  • Path: /rest/api/3/field/{fieldId}/context
  • Operation ID: getContextsForField

Parameters

{
  "fieldId": {
    "description": "The ID of the custom field.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "isAnyIssueType": {
    "description": "Whether to return contexts that apply to all issue types.",
    "required": false,
    "location": "query",
    "type": "boolean"
  },
  "isGlobalContext": {
    "description": "Whether to return contexts that apply to all projects.",
    "required": false,
    "location": "query",
    "type": "boolean"
  },
  "contextId": {
    "description": "The list of context IDs. To include multiple contexts, separate IDs with ampersand: `contextId=10000&contextId=10001`.",
    "required": false,
    "location": "query",
    "type": "array"
  },
  "startAt": {
    "description": "The index of the first item to return in a page of results (page offset).",
    "required": false,
    "location": "query",
    "type": "integer",
    "format": "int64"
  },
  "maxResults": {
    "description": "The maximum number of items to return per page.",
    "required": false,
    "location": "query",
    "type": "integer",
    "format": "int32"
  }
}

Response Schema

{
  "additionalProperties": false,
  "description": "A page of items.",
  "properties": {
    "isLast": {
      "description": "Whether this is the last page.",
      "readOnly": true,
      "type": "boolean"
    },
    "maxResults": {
      "description": "The maximum number of items that could be returned.",
      "format": "int32",
      "readOnly": true,
      "type": "integer"
    },
    "nextPage": {
      "description": "If there is another page of results, the URL of the next page.",
      "format": "uri",
      "readOnly": true,
      "type": "string"
    },
    "self": {
      "description": "The URL of the page.",
      "format": "uri",
      "readOnly": true,
      "type": "string"
    },
    "startAt": {
      "description": "The index of the first item returned.",
      "format": "int64",
      "readOnly": true,
      "type": "integer"
    },
    "total": {
      "description": "The number of items returned.",
      "format": "int64",
      "readOnly": true,
      "type": "integer"
    },
    "values": {
      "description": "The list of items.",
      "items": {
        "additionalProperties": false,
        "description": "The details of a custom field context.",
        "properties": {
          "description": {
            "description": "The description of the context.",
            "type": "string"
          },
          "id": {
            "description": "The ID of the context.",
            "type": "string"
          },
          "isAnyIssueType": {
            "description": "Whether the context apply to all issue types.",
            "type": "boolean"
          },
          "isGlobalContext": {
            "description": "Whether the context is global.",
            "type": "boolean"
          },
          "name": {
            "description": "The name of the context.",
            "type": "string"
          }
        },
        "required": [
          "description",
          "id",
          "isAnyIssueType",
          "isGlobalContext",
          "name"
        ],
        "type": "object"
      },
      "readOnly": true,
      "type": "array"
    }
  },
  "type": "object"
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('jira')

# Call this tool
result = await agent.call_tool('getContextsForField', {
    # Add required parameters here
})