Skip to content

Function: getContextDefaultValues()

ts
function getContextDefaultValues(client, parameters): Promise<{
[key: string]: unknown;
  isLast?: boolean;
  maxResults?: number;
  nextPage?: string;
  self?: string;
  startAt?: number;
  total?: number;
  values?: object[];
}>;

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

Returns a paginated list of default values grouped by custom field context.

Each returned ContextDefaultValuesBean has a contextId and a defaultValues list of IssueTypeDefaultValueBean entries - one per issue-type-scoped default value configured for the context. An entry with "isAnyIssueType": true represents the catch-all default that applies to every issue type covered by the context that is not covered by a more specific entry; a non-null issueTypeId represents a default that only applies to that issue type.

For contexts that have not been converted to the multiple-contexts data model, exactly one entry is returned per context with isAnyIssueType=true. For converted contexts, one entry is returned per configured per-issue-type default.

The value object on each entry is the same polymorphic CustomFieldContextDefaultValueBean exposed by the deprecated GET /defaultValue endpoint - its concrete subtype depends on the custom field's type (see the list of supported types on that endpoint).

Permissions required:Administer Jira global permission.

Parameters

ParameterTypeDescription
clientClient-
parameters{ contextId?: number[]; fieldId: string; issueTypeId?: string[]; maxResults?: number; startAt?: number; }-
parameters.contextId?number[]The IDs of the contexts to return default values for. If omitted, default values for every context the custom field has are returned.
parameters.fieldIdstringThe ID of the custom field, for example customfield\_10000.
parameters.issueTypeId?string[]The IDs of the issue types to restrict the returned per-issue-type default values to. If omitted, default values for every issue type are returned. This filter never removes the catch-all isAnyIssueType entry of a context.
parameters.maxResults?numberThe maximum number of items to return per page.
parameters.startAt?numberThe index of the first item to return in a page of results (page offset).

Returns

Promise<{ [key: string]: unknown; isLast?: boolean; maxResults?: number; nextPage?: string; self?: string; startAt?: number; total?: number; values?: object[]; }>