This resource represents the users assigned to project roles. Use it to get, add, and remove default users from project roles. Also use it to add and remove users from a project role associated with a project.

Hierarchy

  • CommonHttpService
    • ProjectRoleActorsService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

    • getClientInstance: (() => CommonHttpClient)
        • (): CommonHttpClient
        • Returns CommonHttpClient

    Returns ProjectRoleActorsService

Methods

  • Adds actors to a project role for the project.

    To replace all actors for the project, use Set actors for project role.

    This operation can be accessed anonymously.

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

    Parameters

    • params: {
          actorsMap: ActorsMap;
          id: number;
          projectIdOrKey: string;
      }
      • actorsMap: ActorsMap

        The groups or users to associate with the project role for this project. Provide the user account ID, group name, or group ID. As a group's name can change, use of group ID is recommended.

      • id: number

        The ID of the project role. Use Get all project roles to get a list of project role IDs.

      • projectIdOrKey: string

        The project ID or project key (case sensitive).

    Returns Promise<ProjectRole>

    Returned if the request is successful. The complete list of actors for the project is returned.

    For example, the cURL request above adds a group, jira-developers. For the response below to be returned as a result of that request, the user Mia Krystof would have previously been added as a user actor for this project.

    example:

    {
    "actors": [
    {
    "actorGroup": {
    "displayName": "jira-developers",
    "groupId": "952d12c3-5b5b-4d04-bb32-44d383afc4b2",
    "name": "jira-developers"
    },
    "displayName": "jira-developers",
    "id": 10240,
    "name": "jira-developers",
    "type": "atlassian-group-role-actor",
    "user": "jira-developers"
    },
    {
    "actorUser": {
    "accountId": "5b10a2844c20165700ede21g"
    },
    "displayName": "Mia Krystof",
    "id": 10241,
    "type": "atlassian-user-role-actor"
    }
    ],
    "description": "A project role that represents developers in a project",
    "id": 10360,
    "name": "Developers",
    "scope": {
    "project": {
    "id": "10000",
    "key": "KEY",
    "name": "Next Gen Project"
    },
    "type": "PROJECT"
    },
    "self": "https://your-domain.atlassian.net/rest/api/3/project/MKY/role/10360"
    }

    POST /rest/api/3/project/{projectIdOrKey}/role/{id} @scopes-current manage:jira-configuration @scopes-beta read:user:jira, read:group:jira, read:project-role:jira, read:project:jira, write:project-role:jira, read:avatar:jira, read:project-category:jira

  • Adds default actors to a role. You may add groups or users, but you cannot add groups and users in the same request.

    Changing a project role's default actors does not affect project role members for projects already created.

    Permissions required: Administer Jira global permission.

    Parameters

    Returns Promise<ProjectRole>

    Returned if the request is successful.

    example:

    {
    "actors": [
    {
    "actorGroup": {
    "name": "jira-developers",
    "displayName": "jira-developers",
    "groupId": "952d12c3-5b5b-4d04-bb32-44d383afc4b2"
    },
    "displayName": "jira-developers",
    "id": 10240,
    "name": "jira-developers",
    "type": "atlassian-group-role-actor"
    }
    ]
    }

    POST /rest/api/3/role/{id}/actors @scopes-current manage:jira-configuration @scopes-beta read:user:jira, read:group:jira, read:project-role:jira, read:project:jira, write:project-role:jira, read:avatar:jira, read:project-category:jira

  • Deletes actors from a project role for the project.

    To remove default actors from the project role, use Delete default actors from project role.

    This operation can be accessed anonymously.

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

    Parameters

    • params: {
          group?: string;
          groupId?: string;
          id: number;
          projectIdOrKey: string;
          user?: string;
      }
      • Optionalgroup?: string

        The name of the group to remove from the project role. This parameter cannot be used with the groupId parameter. As a group's name can change, use of groupId is recommended.

      • OptionalgroupId?: string

        The ID of the group to remove from the project role. This parameter cannot be used with the group parameter.

      • id: number

        The ID of the project role. Use Get all project roles to get a list of project role IDs.

      • projectIdOrKey: string

        The project ID or project key (case sensitive).

      • Optionaluser?: string

        The user account ID of the user to remove from the project role.

    Returns Promise<void>

    DELETE /rest/api/3/project/{projectIdOrKey}/role/{id} @scopes-current manage:jira-project @scopes-beta delete:project-role:jira

  • Deletes the default actors from a project role. You may delete a group or user, but you cannot delete a group and a user in the same request.

    Changing a project role's default actors does not affect project role members for projects already created.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          group?: string;
          groupId?: string;
          id: number;
          user?: string;
      }
      • Optionalgroup?: string

        The group name of the group to be removed as a default actor.This parameter cannot be used with the groupId parameter. As a group's name can change, use of groupId is recommended.

      • OptionalgroupId?: string

        The group ID of the group to be removed as a default actor. This parameter cannot be used with the group parameter.

      • id: number

        The ID of the project role. Use Get all project roles to get a list of project role IDs.

      • Optionaluser?: string

        The user account ID of the user to remove as a default actor.

    Returns Promise<ProjectRole>

    Returned if the request is successful.

    example:

    {
    "actors": [
    {
    "actorGroup": {
    "name": "jira-developers",
    "displayName": "jira-developers",
    "groupId": "952d12c3-5b5b-4d04-bb32-44d383afc4b2"
    },
    "displayName": "jira-developers",
    "id": 10240,
    "name": "jira-developers",
    "type": "atlassian-group-role-actor"
    }
    ]
    }

    DELETE /rest/api/3/role/{id}/actors @scopes-current manage:jira-configuration @scopes-beta write:project-role:jira, read:user:jira, read:group:jira, read:project-role:jira, read:project:jira, read:avatar:jira, read:project-category:jira

  • Sets the actors for a project role for a project, replacing all existing actors.

    To add actors to the project without overwriting the existing list, use Add actors to project role.

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

    Parameters

    • params: {
          id: number;
          projectIdOrKey: string;
          projectRoleActorsUpdateBean: ProjectRoleActorsUpdateBean;
      }
      • id: number

        The ID of the project role. Use Get all project roles to get a list of project role IDs.

      • projectIdOrKey: string

        The project ID or project key (case sensitive).

      • projectRoleActorsUpdateBean: ProjectRoleActorsUpdateBean

        The groups or users to associate with the project role for this project. Provide the user account ID, group name, or group ID. As a group's name can change, use of group ID is recommended.

    Returns Promise<ProjectRole>

    Returned if the request is successful. The complete list of actors for the project is returned.

    example:

    {
    "actors": [
    {
    "actorGroup": {
    "displayName": "jira-developers",
    "groupId": "952d12c3-5b5b-4d04-bb32-44d383afc4b2",
    "name": "jira-developers"
    },
    "displayName": "jira-developers",
    "id": 10240,
    "name": "jira-developers",
    "type": "atlassian-group-role-actor",
    "user": "jira-developers"
    },
    {
    "actorUser": {
    "accountId": "5b10a2844c20165700ede21g"
    },
    "displayName": "Mia Krystof",
    "id": 10241,
    "type": "atlassian-user-role-actor"
    }
    ],
    "description": "A project role that represents developers in a project",
    "id": 10360,
    "name": "Developers",
    "scope": {
    "project": {
    "id": "10000",
    "key": "KEY",
    "name": "Next Gen Project"
    },
    "type": "PROJECT"
    },
    "self": "https://your-domain.atlassian.net/rest/api/3/project/MKY/role/10360"
    }

    PUT /rest/api/3/project/{projectIdOrKey}/role/{id} @scopes-current manage:jira-project @scopes-beta read:user:jira, read:group:jira, read:project-role:jira, read:project:jira, write:project-role:jira, read:avatar:jira, read:project-category:jira

  • Method to initialize the class. Normally used to set up validation rules.

    Returns void