replaceIssueFieldOption method

Future<TaskProgressBeanRemoveOptionFromIssuesResult> replaceIssueFieldOption({
  1. int? replaceWith,
  2. String? jql,
  3. bool? overrideScreenSecurity,
  4. bool? overrideEditableFlag,
  5. required String fieldKey,
  6. required int optionId,
})

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.

Implementation

Future<TaskProgressBeanRemoveOptionFromIssuesResult> replaceIssueFieldOption(
    {int? replaceWith,
    String? jql,
    bool? overrideScreenSecurity,
    bool? overrideEditableFlag,
    required String fieldKey,
    required int optionId}) async {
  return TaskProgressBeanRemoveOptionFromIssuesResult.fromJson(
      await _client.send(
    'delete',
    'rest/api/3/field/{fieldKey}/option/{optionId}/issue',
    pathParameters: {
      'fieldKey': fieldKey,
      'optionId': '$optionId',
    },
    queryParameters: {
      if (replaceWith != null) 'replaceWith': '$replaceWith',
      if (jql != null) 'jql': jql,
      if (overrideScreenSecurity != null)
        'overrideScreenSecurity': '$overrideScreenSecurity',
      if (overrideEditableFlag != null)
        'overrideEditableFlag': '$overrideEditableFlag',
    },
  ));
}