getProjectRole method

Future<ProjectRole> getProjectRole({
  1. required String projectIdOrKey,
  2. required int id,
  3. bool? excludeInactiveUsers,
})

Returns a project role's details and actors associated with the project. The list of actors is sorted by display name.

To check whether a user belongs to a role based on their group memberships, use Get user with the groups expand parameter selected. Then check whether the user keys and groups match with the actors returned for the project.

This operation can be accessed anonymously.

Permissions required: Administer Projects project permission for the project or Administer Jira global permission.

Implementation

Future<ProjectRole> getProjectRole(
    {required String projectIdOrKey,
    required int id,
    bool? excludeInactiveUsers}) async {
  return ProjectRole.fromJson(await _client.send(
    'get',
    'rest/api/3/project/{projectIdOrKey}/role/{id}',
    pathParameters: {
      'projectIdOrKey': projectIdOrKey,
      'id': '$id',
    },
    queryParameters: {
      if (excludeInactiveUsers != null)
        'excludeInactiveUsers': '$excludeInactiveUsers',
    },
  ));
}