Skip to content

Function: getProjectRole() ​

ts
function getProjectRole(
   client, 
   parameters, 
   options?
): Promise<{
[key: string]: unknown;
  actors?: object[];
  admin?: boolean;
  currentUserRole?: boolean;
  default?: boolean;
  description?: string;
  id?: number;
  name?: string;
  roleConfigurable?: boolean;
  scope?: {
   [key: string]: unknown;
     project?: {
      [key: string]: unknown;
        avatarUrls?: {
         [key: string]: unknown;
           16x16?: string;
           24x24?: string;
           32x32?: string;
           48x48?: string;
        };
        id?: string;
        key?: string;
        name?: string;
        projectCategory?: {
         [key: string]: unknown;
           description?: string;
           id?: string;
           name?: string;
           self?: string;
        };
        projectTypeKey?:   | string & object
           | "software"
           | "service_desk"
           | "business"
           | "product_discovery"
           | "customer_service";
        self?: string;
        simplified?: boolean;
     };
     type?: string & object | "PROJECT" | "TEMPLATE";
  };
  self?: string;
  translatedName?: string;
}>;

Defined in: src/cloud/api/projectRoles.ts:59

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.

Parameters ​

ParameterTypeDescription
clientClient-
parameters{ excludeInactiveUsers?: boolean; id: number; projectIdOrKey: string; }-
parameters.excludeInactiveUsers?booleanExclude inactive users.
parameters.id?numberThe ID of the project role. Use Get all project roles to get a list of project role IDs.
parameters.projectIdOrKey?stringThe project ID or project key (case sensitive).
options?RequestOptions-

Returns ​

Promise<{ [key: string]: unknown; actors?: object[]; admin?: boolean; currentUserRole?: boolean; default?: boolean; description?: string; id?: number; name?: string; roleConfigurable?: boolean; scope?: { [key: string]: unknown; project?: { [key: string]: unknown; avatarUrls?: { [key: string]: unknown; 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; id?: string; key?: string; name?: string; projectCategory?: { [key: string]: unknown; description?: string; id?: string; name?: string; self?: string; }; projectTypeKey?: | string & object | "software" | "service_desk" | "business" | "product_discovery" | "customer_service"; self?: string; simplified?: boolean; }; type?: string & object | "PROJECT" | "TEMPLATE"; }; self?: string; translatedName?: string; }>