Atlassian: Get project role by ID
Atlassian projectRoles.getProjectRoleById: arguments, response, policy and SDK examples.
← Project roles operations · Get started
Operation atlassian.getprojectrolebyid
Provider route: GET /{cloudId}/rest/api/3/role/{id}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/atlassian with npm, or alter-sdk-atlassian with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { AtlassianIntegration } from "@alter-ai/atlassian";
async function execute(input: Parameters<AtlassianIntegration["projectRoles"]["getProjectRoleById"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new AtlassianIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.projectRoles.getProjectRoleById(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_atlassian import AtlassianIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = AtlassianIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.project_roles.get_project_role_by_id(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.cloudId | string | Required within parent | Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
path.id | integer | Required within parent | Format: int64 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Create project role — response body |
Referenced models: Create project role — response body
Schemas
Section titled “Schemas”2 more schemas are linked from the tables above, on the schema pages.
Create project role — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Details about the roles in a project. |
actors | JSON | Optional | |
actors (anyOf 1) | array | Alternative | The list of users who act in this role. Read only: true |
actors (anyOf 1)[] | Model | Each item | Expand Create project role — response body — actors The list of users who act in this role item |
actors (anyOf 2) | null | Alternative | |
admin | JSON | Optional | |
admin (anyOf 1) | boolean | Alternative | Whether this role is the admin role for the project. Read only: true |
admin (anyOf 2) | null | Alternative | |
currentUserRole | JSON | Optional | |
currentUserRole (anyOf 1) | boolean | Alternative | Whether the calling user is part of this role. |
currentUserRole (anyOf 2) | null | Alternative | |
default | JSON | Optional | |
default (anyOf 1) | boolean | Alternative | Whether this role is the default role for the project Read only: true |
default (anyOf 2) | null | Alternative | |
description | JSON | Optional | |
description (anyOf 1) | string | Alternative | The description of the project role. Read only: true |
description (anyOf 2) | null | Alternative | |
id | JSON | Optional | |
id (anyOf 1) | JSON | Alternative | |
id (anyOf 1) (anyOf 1) | integer | Alternative | The ID of the project role. Format: int64 Read only: true |
id (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
id (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The name of the project role. |
name (anyOf 2) | null | Alternative | |
roleConfigurable | JSON | Optional | |
roleConfigurable (anyOf 1) | boolean | Alternative | Whether the roles are configurable for this project. Read only: true |
roleConfigurable (anyOf 2) | null | Alternative | |
scope | JSON | Optional | |
scope (anyOf 1) | Model | Alternative | Expand Get status — response body — scope project, type The scope of the role. Indicated for roles associated with [next-gen projects](https://confluence.atlassian.com/x/loMyO). Read only: true |
scope (anyOf 2) | null | Alternative | |
self | JSON | Optional | |
self (anyOf 1) | string | Alternative | The URL the project role details. Format: uri Read only: true |
self (anyOf 2) | null | Alternative | |
translatedName | JSON | Optional | |
translatedName (anyOf 1) | string | Alternative | The translated name of the project role. |
translatedName (anyOf 2) | null | Alternative |
Referenced models: Create project role — response body — actors The list of users who act in this role item, Get status — response body — scope project, type
Create project role — response body — actors The list of users who act in this role item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Details about a user assigned to a project role. |
actorGroup | JSON | Optional | |
actorGroup (anyOf 1) | Model | Alternative | Expand Create project role — response body — actors The list of users who act in this role item actor Group Details of the group associated with the role Read only: true |
actorGroup (anyOf 2) | null | Alternative | |
actorUser | JSON | Optional | |
actorUser (anyOf 1) | Model | Alternative | Expand Create project role — response body — actors The list of users who act in this role item actor User Details of the user associated with the role Read only: true |
actorUser (anyOf 2) | null | Alternative | |
avatarUrl | JSON | Optional | |
avatarUrl (anyOf 1) | string | Alternative | The avatar of the role actor. Format: uri Read only: true |
avatarUrl (anyOf 2) | null | Alternative | |
displayName | JSON | Optional | |
displayName (anyOf 1) | string | Alternative | The display name of the role actor. For users, depending on the user’s privacy setting, this may return an alternative value for the user's name. Read only: true |
displayName (anyOf 2) | null | Alternative | |
id | JSON | Optional | |
id (anyOf 1) | JSON | Alternative | |
id (anyOf 1) (anyOf 1) | integer | Alternative | The ID of the role actor. Format: int64 Read only: true |
id (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
id (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. Read only: true |
name (anyOf 2) | null | Alternative | |
type | JSON | Optional | |
type (anyOf 1) | string | Alternative | The type of role actor. Known values: atlassian-group-role-actor, atlassian-user-role-actor Read only: true |
type (anyOf 2) | null | Alternative |
Referenced models: Create project role — response body — actors The list of users who act in this role item actor Group Details of the group associated with the role, Create project role — response body — actors The list of users who act in this role item actor User Details of the user associated with the role
Get status — response body — scope project, type
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The projects the item is associated with. Indicated for items associated with [next-gen projects](https://confluence.atlassian.com/x/loMyO). Additional keys: allowed |
project | JSON | Optional | |
project (anyOf 1) | Model | Alternative | Expand Get issue type screen scheme projects — response body — values The list of items item The project the item has scope in. Read only: true |
project (anyOf 2) | null | Alternative | |
type | JSON | Optional | |
type (anyOf 1) | string | Alternative | The type of scope. Known values: PROJECT, TEMPLATE Read only: true |
type (anyOf 2) | null | Alternative |
Referenced models: Get issue type screen scheme projects — response body — values The list of items item
Create project role — response body — actors The list of users who act in this role item actor Group Details of the group associated with the role
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Details of the group associated with the role. |
displayName | JSON | Optional | |
displayName (anyOf 1) | string | Alternative | The display name of the group. |
displayName (anyOf 2) | null | Alternative | |
groupId | JSON | Optional | |
groupId (anyOf 1) | string | Alternative | The ID of the group. |
groupId (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The name of the group. As a group's name can change, use of `groupId` is recommended to identify the group. |
name (anyOf 2) | null | Alternative |
Create project role — response body — actors The list of users who act in this role item actor User Details of the user associated with the role
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Details of the user associated with the role. |
accountId | JSON | Optional | |
accountId (anyOf 1) | string | Alternative | The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Returns *unknown* if the record is deleted and corrupted, for example, as the result of a server import. Maximum length: 128 Read only: true |
accountId (anyOf 2) | null | Alternative |
Get user — response body — avatar Urls 16x16, 24x24, 32x32, 48x48
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
16x16 | JSON | Optional | |
16x16 (anyOf 1) | string | Alternative | The URL of the item's 16x16 pixel avatar. Format: uri |
16x16 (anyOf 2) | null | Alternative | |
24x24 | JSON | Optional | |
24x24 (anyOf 1) | string | Alternative | The URL of the item's 24x24 pixel avatar. Format: uri |
24x24 (anyOf 2) | null | Alternative | |
32x32 | JSON | Optional | |
32x32 (anyOf 1) | string | Alternative | The URL of the item's 32x32 pixel avatar. Format: uri |
32x32 (anyOf 2) | null | Alternative | |
48x48 | JSON | Optional | |
48x48 (anyOf 1) | string | Alternative | The URL of the item's 48x48 pixel avatar. Format: uri |
48x48 (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: atlassian.getprojectrolebyid. Catalog operation: getprojectrolebyid. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["manage:jira-configuration"]