addWorklog method

Future<Worklog> addWorklog({
  1. required String issueIdOrKey,
  2. bool? notifyUsers,
  3. String? adjustEstimate,
  4. String? newEstimate,
  5. String? reduceBy,
  6. String? expand,
  7. bool? overrideEditableFlag,
  8. required Worklog body,
})

Adds a worklog to 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:

Implementation

Future<Worklog> addWorklog(
    {required String issueIdOrKey,
    bool? notifyUsers,
    String? adjustEstimate,
    String? newEstimate,
    String? reduceBy,
    String? expand,
    bool? overrideEditableFlag,
    required Worklog body}) async {
  return Worklog.fromJson(await _client.send(
    'post',
    'rest/api/3/issue/{issueIdOrKey}/worklog',
    pathParameters: {
      'issueIdOrKey': issueIdOrKey,
    },
    queryParameters: {
      if (notifyUsers != null) 'notifyUsers': '$notifyUsers',
      if (adjustEstimate != null) 'adjustEstimate': adjustEstimate,
      if (newEstimate != null) 'newEstimate': newEstimate,
      if (reduceBy != null) 'reduceBy': reduceBy,
      if (expand != null) 'expand': expand,
      if (overrideEditableFlag != null)
        'overrideEditableFlag': '$overrideEditableFlag',
    },
    body: body.toJson(),
  ));
}