getTasks method

Future<MultiEntityResult<Task>> getTasks({
  1. String? bodyFormat,
  2. bool? includeBlankTasks,
  3. String? status,
  4. List<int>? taskId,
  5. List<int>? spaceId,
  6. List<int>? pageId,
  7. List<int>? blogpostId,
  8. List<String>? createdBy,
  9. List<String>? assignedTo,
  10. List<String>? completedBy,
  11. int? createdAtFrom,
  12. int? createdAtTo,
  13. int? dueAtFrom,
  14. int? dueAtTo,
  15. int? completedAtFrom,
  16. int? completedAtTo,
  17. String? cursor,
  18. int? limit,
  19. bool? serializeIdsAsStrings,
})

Returns all tasks. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

Permissions required: Permission to access the Confluence site ('Can use' global permission). Only tasks that the user has permission to view will be returned.

Implementation

Future<MultiEntityResult<Task>> getTasks(
    {String? bodyFormat,
    bool? includeBlankTasks,
    String? status,
    List<int>? taskId,
    List<int>? spaceId,
    List<int>? pageId,
    List<int>? blogpostId,
    List<String>? createdBy,
    List<String>? assignedTo,
    List<String>? completedBy,
    int? createdAtFrom,
    int? createdAtTo,
    int? dueAtFrom,
    int? dueAtTo,
    int? completedAtFrom,
    int? completedAtTo,
    String? cursor,
    int? limit,
    bool? serializeIdsAsStrings}) async {
  return MultiEntityResult.fromJson(
    await _client.send(
      'get',
      'tasks',
      queryParameters: {
        if (bodyFormat != null) 'body-format': bodyFormat,
        if (includeBlankTasks != null)
          'include-blank-tasks': '$includeBlankTasks',
        if (status != null) 'status': status,
        if (taskId != null) 'task-id': taskId.map((e) => '$e').join(','),
        if (spaceId != null) 'space-id': spaceId.map((e) => '$e').join(','),
        if (pageId != null) 'page-id': pageId.map((e) => '$e').join(','),
        if (blogpostId != null)
          'blogpost-id': blogpostId.map((e) => '$e').join(','),
        if (createdBy != null)
          'created-by': createdBy.map((e) => e).join(','),
        if (assignedTo != null)
          'assigned-to': assignedTo.map((e) => e).join(','),
        if (completedBy != null)
          'completed-by': completedBy.map((e) => e).join(','),
        if (createdAtFrom != null) 'created-at-from': '$createdAtFrom',
        if (createdAtTo != null) 'created-at-to': '$createdAtTo',
        if (dueAtFrom != null) 'due-at-from': '$dueAtFrom',
        if (dueAtTo != null) 'due-at-to': '$dueAtTo',
        if (completedAtFrom != null) 'completed-at-from': '$completedAtFrom',
        if (completedAtTo != null) 'completed-at-to': '$completedAtTo',
        if (cursor != null) 'cursor': cursor,
        if (limit != null) 'limit': '$limit',
        if (serializeIdsAsStrings != null)
          'serialize-ids-as-strings': '$serializeIdsAsStrings',
      },
    ),
    reviver: (v) => Task.fromJson(v as Map<String, Object?>),
  );
}