getIssuesForBoard method

Future<SearchResults> getIssuesForBoard({
  1. required int boardId,
  2. int? startAt,
  3. int? maxResults,
  4. String? jql,
  5. bool? validateQuery,
  6. List<Map<String, dynamic>>? fields,
  7. String? expand,
})

Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned issues are ordered by rank.

Implementation

Future<SearchResults> getIssuesForBoard(
    {required int boardId,
    int? startAt,
    int? maxResults,
    String? jql,
    bool? validateQuery,
    List<Map<String, dynamic>>? fields,
    String? expand}) async {
  return SearchResults.fromJson(await _client.send(
    'get',
    'rest/agile/1.0/board/{boardId}/issue',
    pathParameters: {
      'boardId': '$boardId',
    },
    queryParameters: {
      if (startAt != null) 'startAt': '$startAt',
      if (maxResults != null) 'maxResults': '$maxResults',
      if (jql != null) 'jql': jql,
      if (validateQuery != null) 'validateQuery': '$validateQuery',
      if (fields != null) 'fields': fields.map((e) => '$e').join(','),
      if (expand != null) 'expand': expand,
    },
  ));
}