Skip to content

Function: addIssueTypesToContext() ​

ts
function addIssueTypesToContext(
   client, 
   parameters, 
   options?
): Promise<void>;

Defined in: src/cloud/api/issueCustomFieldContexts.ts:329

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

A custom field context without any issue types applies to all issue types. Adding issue types replaces the any-issue-type mapping unless isAnyIssueType is true. A supplied defaultValue applies to newly added mappings. If omitted, the default value of the first existing issue type mapping is copied. Existing mappings retain their defaults.

If any of the issue types exists in the custom field context, the operation fails and no issue types are added.

This API will not allow adding issue types to the global context from April 2026. Instead, an HTTP 400 response will be returned. See CHANGE-3019

Permissions required:Administer Jira global permission.

Parameters ​

ParameterTypeDescription
clientClient-
parameters{ contextId: number; defaultValue?: | { cascadingOptionId?: string; contextId: string; optionId: string; type: "option.cascading"; } | { contextId: string; optionIds: string[]; type: "option.multiple"; } | { contextId: string; optionId: string; type: "option.single"; } | { accountId: string; contextId: string; type: "single.user.select"; userFilter: { enabled: boolean; groups?: string[]; roleIds?: number[]; }; } | { accountIds: string[]; contextId: string; type: "multi.user.select"; } | { contextId: string; groupId: string; type: "grouppicker.single"; } | { contextId: string; groupIds: string[]; type: "grouppicker.multiple"; } | { contextId: string; date?: string; type: "datepicker"; useCurrent?: boolean; } | { contextId: string; dateTime?: string; type: "datetimepicker"; useCurrent?: boolean; } | { contextId: string; type: "url"; url: string; } | { contextId: string; projectId: string; type: "project"; } | { contextId: string; number: number; type: "float"; } | { contextId: string; labels: string[]; type: "labels"; } | { contextId: string; text?: string; type: "textfield"; } | { contextId: string; text?: string; type: "textarea"; } | { contextId: string; text?: string; type: "readonly"; } | { contextId: string; type: "version.single"; versionId: string; versionOrder?: string; } | { contextId: string; type: "version.multiple"; versionIds: string[]; versionOrder?: string; } | { contextId: string; text?: string; type: "forge.string"; } | { contextId: string; type: "forge.string.list"; values?: string[]; } | { contextId: string; object?: Record<string, any>; type: "forge.object"; } | { contextId: string; dateTime?: string; type: "forge.datetime"; useCurrent?: boolean; } | { contextId: string; groupId: string; type: "forge.group"; } | { contextId: string; groupIds: string[]; type: "forge.group.list"; } | { contextId: string; number: number; type: "forge.number"; } | { accountId: string; contextId: string; type: "forge.user"; userFilter: { enabled: boolean; groups?: string[]; roleIds?: number[]; }; } | { accountIds: string[]; contextId: string; type: "forge.user.list"; }; fieldId: string; isAnyIssueType?: boolean; issueTypeIds?: (string | null)[] | null; }-
parameters.contextIdnumberThe ID of the context.
parameters.defaultValue?| { cascadingOptionId?: string; contextId: string; optionId: string; type: "option.cascading"; } | { contextId: string; optionIds: string[]; type: "option.multiple"; } | { contextId: string; optionId: string; type: "option.single"; } | { accountId: string; contextId: string; type: "single.user.select"; userFilter: { enabled: boolean; groups?: string[]; roleIds?: number[]; }; } | { accountIds: string[]; contextId: string; type: "multi.user.select"; } | { contextId: string; groupId: string; type: "grouppicker.single"; } | { contextId: string; groupIds: string[]; type: "grouppicker.multiple"; } | { contextId: string; date?: string; type: "datepicker"; useCurrent?: boolean; } | { contextId: string; dateTime?: string; type: "datetimepicker"; useCurrent?: boolean; } | { contextId: string; type: "url"; url: string; } | { contextId: string; projectId: string; type: "project"; } | { contextId: string; number: number; type: "float"; } | { contextId: string; labels: string[]; type: "labels"; } | { contextId: string; text?: string; type: "textfield"; } | { contextId: string; text?: string; type: "textarea"; } | { contextId: string; text?: string; type: "readonly"; } | { contextId: string; type: "version.single"; versionId: string; versionOrder?: string; } | { contextId: string; type: "version.multiple"; versionIds: string[]; versionOrder?: string; } | { contextId: string; text?: string; type: "forge.string"; } | { contextId: string; type: "forge.string.list"; values?: string[]; } | { contextId: string; object?: Record<string, any>; type: "forge.object"; } | { contextId: string; dateTime?: string; type: "forge.datetime"; useCurrent?: boolean; } | { contextId: string; groupId: string; type: "forge.group"; } | { contextId: string; groupIds: string[]; type: "forge.group.list"; } | { contextId: string; number: number; type: "forge.number"; } | { accountId: string; contextId: string; type: "forge.user"; userFilter: { enabled: boolean; groups?: string[]; roleIds?: number[]; }; } | { accountIds: string[]; contextId: string; type: "forge.user.list"; }-
parameters.fieldId?stringThe ID of the custom field.
parameters.isAnyIssueType?booleanWhether to add or retain the any-issue-type mapping. At least one of this property or issueTypeIds is required. Defaults to false.
parameters.issueTypeIds?(string | null)[] | nullThe issue type IDs to add. Optional when isAnyIssueType is true.
options?RequestOptions-

Returns ​

Promise<void>