jira.js
    Preparing search index...

    Function replaceIssueFieldOption

    • Deselects an issue-field select-list option from all issues where it is selected. A different option can be selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL query.

      Connect and Forge app users with Administer Jira global permission can override the screen security configuration using overrideScreenSecurity and overrideEditableFlag.

      This is an asynchronous operation. The response object contains a link to the long-running task.

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

      Permissions required: Administer Jira global permission. Jira permissions are not required for the app providing the field.

      Parameters

      • client: Client
      • parameters: {
            fieldKey: string;
            jql?: string;
            optionId: number;
            overrideEditableFlag?: boolean;
            overrideScreenSecurity?: boolean;
            replaceWith?: number;
        }
        • fieldKey: string

          The field key is specified in the following format: $(app-key)__$(field-key). For example, example-add-on__example-issue-field. To determine the fieldKey value, do one of the following:

          • Open the app's plugin descriptor, then app-key is the key at the top and field-key is the key in the jiraIssueFields module. app-key can also be found in the app listing in the Atlassian Universal Plugin Manager.
          • Run Get fields and in the field details the value is returned in key. For example, "key": "teams-add-on__team-issue-field"
        • Optionaljql?: string

          A JQL query that specifies the issues to be updated. For example, project=10000.

        • optionId: number

          The ID of the option to be deselected.

        • OptionaloverrideEditableFlag?: boolean

          Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app users with Administer Jira global permission.

        • OptionaloverrideScreenSecurity?: boolean

          Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app users with admin permission.

        • OptionalreplaceWith?: number

          The ID of the option that will replace the currently selected option.

      • Optionaloptions: RequestOptions

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