Page cover

๐ŸณContext

The Jira Field Context Configurations define the scope of custom fields within Jira. They determine where and how a custom field can be used within Jira, such as in which projects, issue types, and screens the field should be available. Field Context Configurations are used to ensure that the right data is captured and displayed in Jira, and that users are not presented with irrelevant fields.

Official Documentation

Get custom field contexts

GET /rest/api/{2-3}/field/{fieldId}/context

Returns a paginated list of contexts

for a custom field. Contexts can be returned as follows:

  • With no other parameters set, all contexts.

  • By defining id only, all contexts from the list of IDs.

  • By defining isAnyIssueType, limit the list of contexts returned to either those that apply to all issue types (true) or those that apply to only a subset of issue types (false)

  • By defining isGlobalContext, limit the list of contexts return to either those that apply to all projects (global contexts) (true) or those that apply to only a subset of projects (false)

Create custom field context

POST /rest/api/{2-3}/field/{fieldId}/context

Creates a custom field context. If projectIds is empty, a global context is created. A global context is one that applies to all project. If issueTypeIds is empty, the context applies to all issue types, the method returns the following information:

Get custom field contexts default values

GET /rest/api/{2-3}/field/{fieldId}/context/defaultValue

Returns a paginated list of defaults for a custom field. The results can be filtered by contextId, otherwise all values are returned. If no defaults are set for a context, nothing is returned.

Set custom field contexts default values

PUT /rest/api/{2-3}/field/{fieldId}/context/defaultValue

Sets default for contexts of a custom field. Default is defined using these objects:

Name
Type
Description

CustomFieldContextDefaultValueSingleOption

option.single

For single choice select lists and radio buttons.

CustomFieldContextDefaultValueMultipleOption

option.multiple

For multiple-choice select lists and checkboxes.

CustomFieldContextDefaultValueCascadingOption

option.cascading

For cascading select lists.

Only one type of default object can be included in a request. To remove a default for a context, set the default parameter to null.

Update custom field context

PUT /rest/api/{2-3}/field/{fieldId}/context/{contextId}

Updates a custom field context.

Delete custom field context

DELETE /rest/api/{2-3}/field/{fieldId}/context/{contextId}

Deletes a custom field context.

Add issue types to context

PUT /rest/api/{2-3}/field/{fieldId}/context/{contextId}/issuetype

Adds issue types to a custom field context, appending the issue types to the issue types list.

Remove issue types from context

POST /rest/api/{2-3}/field/{fieldId}/context/{contextId}/issuetype/remove

Removes issue types from a custom field context.

Assign custom field context to projects

PUT /rest/api/{2-3}/field/{fieldId}/context/{contextId}/project

Assigns a custom field context to projects.

Remove custom field context from projects

POST /rest/api/{2-3}/field/{fieldId}/context/{contextId}/project/remove

Removes a custom field context from projects.

Get project mappings for custom field context

GET /rest/api/{2-3}/field/{fieldId}/context/projectmapping

Returns a paginated list of context to project mappings for a custom field. The result can be filtered by contextId. Otherwise, all mappings are returned. Invalid IDs are ignored.

Last updated

Was this helpful?