Skip to content

Function: replaceCustomFieldOption() ​

ts
function replaceCustomFieldOption(
   client, 
   parameters, 
   options?
): Promise<{
[key: string]: unknown;
  description?: string;
  elapsedRuntime: number;
  finished?: number;
  id: string;
  lastUpdate: number;
  message?: string;
  progress: number;
  result?: {
   [key: string]: unknown;
     errors?: {
      [key: string]: unknown;
        errorMessages?: string[];
        errors?: Record<string, string>;
        httpStatusCode?: number;
     };
     modifiedIssues?: number[];
     unmodifiedIssues?: number[];
  };
  self: string;
  started?: number;
  status:   | string & object
     | "ENQUEUED"
     | "RUNNING"
     | "COMPLETE"
     | "FAILED"
     | "CANCEL_REQUESTED"
     | "CANCELLED"
     | "DEAD";
  submitted: number;
  submittedBy: number;
}>;

Defined in: src/cloud/api/issueCustomFieldOptions.ts:227

Replaces the options of a custom field.

Note that this operation only works for issue field select list options created in Jira or using operations from the Issue custom field options resource, it cannot be used with issue field select list options created by Connect or Forge apps.

Permissions required:Administer Jira global permission.

Parameters ​

ParameterTypeDescription
clientClient-
parameters{ contextId: number; fieldId: string; jql?: string; optionId: number; replaceWith?: number; }-
parameters.contextIdnumberThe ID of the context.
parameters.fieldId?stringThe ID of the custom field.
parameters.jql?stringA JQL query that specifies the issues to be updated. For example, project=10000.
parameters.optionId?numberThe ID of the option to be deselected.
parameters.replaceWith?numberThe ID of the option that will replace the currently selected option.
options?RequestOptions-

Returns ​

Promise<{ [key: string]: unknown; description?: string; elapsedRuntime: number; finished?: number; id: string; lastUpdate: number; message?: string; progress: number; result?: { [key: string]: unknown; errors?: { [key: string]: unknown; errorMessages?: string[]; errors?: Record<string, string>; httpStatusCode?: number; }; modifiedIssues?: number[]; unmodifiedIssues?: number[]; }; self: string; started?: number; status: | string & object | "ENQUEUED" | "RUNNING" | "COMPLETE" | "FAILED" | "CANCEL_REQUESTED" | "CANCELLED" | "DEAD"; submitted: number; submittedBy: number; }>