Developer
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
  • backlog
  • board
  • epic
  • issue
  • sprint
  • application-properties
  • applicationrole
  • attachment
  • avatar
  • cluster
  • comment
  • component
  • configuration
  • customFieldOption
  • customFields
  • dashboard
  • email-templates
  • field
  • filter
  • group
  • groups
  • groupuserpicker
  • index-snapshot
  • index
  • issueLinkType
  • issuesecurityschemes
  • issuetype
  • issuetypescheme
  • jql
  • licenseValidator
  • monitoring
  • mypermissions
  • mypreferences
  • myself
  • notificationscheme
  • password
  • permissions
  • permissionscheme
  • priority
  • priorityschemes
  • project
  • projectCategory
  • projects
  • projectvalidate
  • reindex
  • resolution
  • role
  • screens
  • securitylevel
  • serverInfo
  • settings
  • status
  • statuscategory
  • terminology
  • universal_avatar
  • upgrade
  • user
  • version
  • workflow
  • workflowscheme
  • worklog
  • session
  • websudo
Server
Jira Data Center / / Modules

role

Postman Collection
OpenAPI
GET

Get all project roles

Get all the ProjectRoles available in Jira. Currently this list is global.

Forge and OAuth2 apps cannot access this REST resource.

Request

This request has no parameters.

Responses

Returns full details of the roles available in Jira.

application/json

ProjectRoleBean
GET/api/2/role
1 2 3 4 curl --request GET \ --url 'http://{baseurl}/rest/api/2/role' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "actors": [ { "name": "jira-developers" } ], "description": "A project role that represents developers in a project", "id": 10360, "name": "Developers", "self": "http://www.example.com/jira/rest/api/2/project/MKY/role/10360" }
POST

Create a new project role

Creates a new ProjectRole to be available in Jira. The created role does not have any default actors assigned.

Forge and OAuth2 apps cannot access this REST resource.

Request

Request bodyapplication/json

The role to create

description

string

name

string

Responses

Returns full details of the created role

application/json

ProjectRoleBean
POST/api/2/role
1 2 3 4 5 6 7 8 9 curl --request POST \ --url 'http://{baseurl}/rest/api/2/role' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "description": "role description", "name": "MyRole" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "actors": [ { "name": "jira-developers" } ], "description": "A project role that represents developers in a project", "id": 10360, "name": "Developers", "self": "http://www.example.com/jira/rest/api/2/project/MKY/role/10360" }
GET

Get a specific project role

Get a specific ProjectRole available in Jira.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

id

integer

Required

Responses

Returns full details of the role available in Jira.

application/json

ProjectRoleBean
GET/api/2/role/{id}
1 2 3 4 curl --request GET \ --url 'http://{baseurl}/rest/api/2/role/{id}' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "actors": [ { "name": "jira-developers" } ], "description": "A project role that represents developers in a project", "id": 10360, "name": "Developers", "self": "http://www.example.com/jira/rest/api/2/project/MKY/role/10360" }
PUT

Fully updates a role's name and description

Fully updates a roles. Both name and description must be given.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

id

integer

Required

Request bodyapplication/json

description

string

name

string

Responses

Returns updated role.

application/json

ProjectRoleBean
PUT/api/2/role/{id}
1 2 3 4 5 6 7 8 9 curl --request PUT \ --url 'http://{baseurl}/rest/api/2/role/{id}' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "description": "role description", "name": "MyRole" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "actors": [ { "name": "jira-developers" } ], "description": "A project role that represents developers in a project", "id": 10360, "name": "Developers", "self": "http://www.example.com/jira/rest/api/2/project/MKY/role/10360" }
POST

Partially updates a role's name or description

Partially updates a roles name or description.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

id

integer

Required

Request bodyapplication/json

description

string

name

string

Responses

Returns updated role.

application/json

ProjectRoleBean
POST/api/2/role/{id}
1 2 3 4 5 6 7 8 9 curl --request POST \ --url 'http://{baseurl}/rest/api/2/role/{id}' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "description": "role description", "name": "MyRole" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "actors": [ { "name": "jira-developers" } ], "description": "A project role that represents developers in a project", "id": 10360, "name": "Developers", "self": "http://www.example.com/jira/rest/api/2/project/MKY/role/10360" }
DEL

Deletes a role

Deletes a role. May return 403 in the future

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

id

integer

Required

Query parameters

swap

integer

Responses

Returned if the delete was successful.

DEL/api/2/role/{id}
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/2/role/{id}' \ --user 'email@example.com:<api_token>'
GET

Get default actors for a role

Gets default actors for the given role.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

id

integer

Required

Responses

Returns actor list.

application/json

ProjectRoleActorsBean
GET/api/2/role/{id}/actors
1 2 3 4 curl --request GET \ --url 'http://{baseurl}/rest/api/2/role/{id}/actors' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "actors": [ { "name": "jira-developers" } ] }
POST

Adds default actors to a role

Adds default actors to the given role. The request data should contain a list of usernames or a list of groups to add.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

id

integer

Required

Request bodyapplication/json

group

array<string>

user

array<string>

Responses

Returns actor list.

application/json

ProjectRoleActorsBean
POST/api/2/role/{id}/actors
1 2 3 4 5 6 7 8 9 10 11 12 13 curl --request POST \ --url 'http://{baseurl}/rest/api/2/role/{id}/actors' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "group": [ "<string>" ], "user": [ "<string>" ] }'
200Response
1 2 3 4 5 6 7 { "actors": [ { "name": "jira-developers" } ] }
DEL

Removes default actor from a role

Removes default actor from the given role.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

id

integer

Required

Query parameters

user

string

group

string

Responses

Returns updated actors list.

application/json

ProjectRoleActorsBean
DEL/api/2/role/{id}/actors
1 2 3 4 curl --request DELETE \ --url 'http://{baseurl}/rest/api/2/role/{id}/actors' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "actors": [ { "name": "jira-developers" } ] }

Rate this page: