Skip to content

Atlassian: Create project role

Atlassian projectRoles.createProjectRole: arguments, response, policy and SDK examples.

← Project roles operations · Get started

Operation atlassian.createprojectrole

Provider route: POST /{cloudId}/rest/api/3/role. Alter supplies the connection’s credentials and routing.

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"]["createProjectRole"]>[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.createProjectRole(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from 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.create_project_role(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.cloudIdstringRequired within parentPattern: ^[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}$
bodyModelRequired within parentExpand Create project role — request body — body

Referenced models: Create project role — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create project role — response body

Referenced models: Create project role — response body

3 more schemas are linked from the tables above, on the schema pages.

Create project role — request body — body
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
descriptionstringOptionalA description of the project role. Required when fully updating a project role. Optional when creating or partially updating a project role.
namestringOptionalThe name of the project role. Must be unique. Cannot begin or end with whitespace. The maximum length is 255 characters. Required when creating a project role. Optional when partially updating a project role.
Create project role — response body
FieldTypePresenceDescription and constraints
$objectRootDetails about the roles in a project.
actorsJSONOptional
actors (anyOf 1)arrayAlternativeThe list of users who act in this role.
Read only: true
actors (anyOf 1)[]ModelEach itemExpand Create project role — response body — actors The list of users who act in this role item
actors (anyOf 2)nullAlternative
adminJSONOptional
admin (anyOf 1)booleanAlternativeWhether this role is the admin role for the project.
Read only: true
admin (anyOf 2)nullAlternative
currentUserRoleJSONOptional
currentUserRole (anyOf 1)booleanAlternativeWhether the calling user is part of this role.
currentUserRole (anyOf 2)nullAlternative
defaultJSONOptional
default (anyOf 1)booleanAlternativeWhether this role is the default role for the project
Read only: true
default (anyOf 2)nullAlternative
descriptionJSONOptional
description (anyOf 1)stringAlternativeThe description of the project role.
Read only: true
description (anyOf 2)nullAlternative
idJSONOptional
id (anyOf 1)JSONAlternative
id (anyOf 1) (anyOf 1)integerAlternativeThe ID of the project role.
Format: int64
Read only: true
id (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
id (anyOf 2)nullAlternative
nameJSONOptional
name (anyOf 1)stringAlternativeThe name of the project role.
name (anyOf 2)nullAlternative
roleConfigurableJSONOptional
roleConfigurable (anyOf 1)booleanAlternativeWhether the roles are configurable for this project.
Read only: true
roleConfigurable (anyOf 2)nullAlternative
scopeJSONOptional
scope (anyOf 1)ModelAlternativeExpand 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)nullAlternative
selfJSONOptional
self (anyOf 1)stringAlternativeThe URL the project role details.
Format: uri
Read only: true
self (anyOf 2)nullAlternative
translatedNameJSONOptional
translatedName (anyOf 1)stringAlternativeThe translated name of the project role.
translatedName (anyOf 2)nullAlternative

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
FieldTypePresenceDescription and constraints
$objectRootDetails about a user assigned to a project role.
actorGroupJSONOptional
actorGroup (anyOf 1)ModelAlternativeExpand 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)nullAlternative
actorUserJSONOptional
actorUser (anyOf 1)ModelAlternativeExpand 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)nullAlternative
avatarUrlJSONOptional
avatarUrl (anyOf 1)stringAlternativeThe avatar of the role actor.
Format: uri
Read only: true
avatarUrl (anyOf 2)nullAlternative
displayNameJSONOptional
displayName (anyOf 1)stringAlternativeThe 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)nullAlternative
idJSONOptional
id (anyOf 1)JSONAlternative
id (anyOf 1) (anyOf 1)integerAlternativeThe ID of the role actor.
Format: int64
Read only: true
id (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
id (anyOf 2)nullAlternative
nameJSONOptional
name (anyOf 1)stringAlternativeThis 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)nullAlternative
typeJSONOptional
type (anyOf 1)stringAlternativeThe type of role actor.
Known values: atlassian-group-role-actor, atlassian-user-role-actor
Read only: true
type (anyOf 2)nullAlternative

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
FieldTypePresenceDescription and constraints
$objectRootThe projects the item is associated with. Indicated for items associated with [next-gen projects](https://confluence.atlassian.com/x/loMyO).
Additional keys: allowed
projectJSONOptional
project (anyOf 1)ModelAlternativeExpand 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)nullAlternative
typeJSONOptional
type (anyOf 1)stringAlternativeThe type of scope.
Known values: PROJECT, TEMPLATE
Read only: true
type (anyOf 2)nullAlternative

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
FieldTypePresenceDescription and constraints
$objectRootDetails of the group associated with the role.
displayNameJSONOptional
displayName (anyOf 1)stringAlternativeThe display name of the group.
displayName (anyOf 2)nullAlternative
groupIdJSONOptional
groupId (anyOf 1)stringAlternativeThe ID of the group.
groupId (anyOf 2)nullAlternative
nameJSONOptional
name (anyOf 1)stringAlternativeThe name of the group. As a group's name can change, use of `groupId` is recommended to identify the group.
name (anyOf 2)nullAlternative
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
FieldTypePresenceDescription and constraints
$objectRootDetails of the user associated with the role.
accountIdJSONOptional
accountId (anyOf 1)stringAlternativeThe 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)nullAlternative

SDK function policy ID: atlassian.createprojectrole. Catalog operation: createprojectrole. 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"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.