deleteWorklog method

Future<void> deleteWorklog({
  1. required String issueIdOrKey,
  2. required String id,
  3. bool? notifyUsers,
  4. String? adjustEstimate,
  5. String? newEstimate,
  6. String? increaseBy,
  7. bool? overrideEditableFlag,
})

Deletes a worklog from an issue.

Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see Configuring time tracking.

This operation can be accessed anonymously.

Permissions required:

  • Browse projects project permission for the project that the issue is in.
  • If issue-level security is configured, issue-level security permission to view the issue.
  • Delete all worklogs project permission to delete any worklog or Delete own worklogs to delete worklogs created by the user,
  • If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.

Implementation

Future<void> deleteWorklog(
    {required String issueIdOrKey,
    required String id,
    bool? notifyUsers,
    String? adjustEstimate,
    String? newEstimate,
    String? increaseBy,
    bool? overrideEditableFlag}) async {
  await _client.send(
    'delete',
    'rest/api/3/issue/{issueIdOrKey}/worklog/{id}',
    pathParameters: {
      'issueIdOrKey': issueIdOrKey,
      'id': id,
    },
    queryParameters: {
      if (notifyUsers != null) 'notifyUsers': '$notifyUsers',
      if (adjustEstimate != null) 'adjustEstimate': adjustEstimate,
      if (newEstimate != null) 'newEstimate': newEstimate,
      if (increaseBy != null) 'increaseBy': increaseBy,
      if (overrideEditableFlag != null)
        'overrideEditableFlag': '$overrideEditableFlag',
    },
  );
}