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.
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.
manage:jira-project
read:user:jira
, read:group:jira
, read:project-role:jira
, read:project:jira
, write:project-role:jira
...(Show more)Connect app scope required: PROJECT_ADMIN
string
Requiredinteger
RequiredThe 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.
object
Returned if the request is successful. The complete list of actors for the project is returned.
Details about the roles in a project.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"categorisedActors": {
"atlassian-group-role-actor-id": [
"952d12c3-5b5b-4d04-bb32-44d383afc4b2"
],
"atlassian-user-role-actor": [
"12345678-9abc-def1-2345-6789abcdef12"
]
}
}`;
const response = await api.asUser().requestJira(route`/rest/api/3/project/{projectIdOrKey}/role/{id}`, {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"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"
}
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.
manage:jira-configuration
read:user:jira
, read:group:jira
, read:project-role:jira
, read:project:jira
, write:project-role:jira
...(Show more)Connect app scope required: PROJECT_ADMIN
string
Requiredinteger
RequiredThe 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.
array<string>
array<string>
array<string>
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.
Details about the roles in a project.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"groupId": [
"952d12c3-5b5b-4d04-bb32-44d383afc4b2"
]
}`;
const response = await api.asUser().requestJira(route`/rest/api/3/project/{projectIdOrKey}/role/{id}`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"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"
}
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.
manage:jira-project
delete:project-role:jira
Connect app scope required: PROJECT_ADMIN
string
Requiredinteger
Requiredstring
string
string
Returned if the request is successful.
1
2
3
4
5
6
7
8
9
10
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestJira(route`/rest/api/3/project/{projectIdOrKey}/role/{id}?user=5b10ac8d82e05b22cc7d4ef5`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Returns the default actors for the project role.
Permissions required: Administer Jira global permission.
manage:jira-configuration
read:user:jira
, read:group:jira
, read:project-role:jira
, read:project:jira
, read:avatar:jira
...(Show more)Connect app scope required: ADMIN
integer
RequiredReturned if the request is successful.
Details about the roles in a project.
1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestJira(route`/rest/api/3/role/{id}/actors`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"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"
}
]
}
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.
manage:jira-configuration
read:user:jira
, read:group:jira
, read:project-role:jira
, read:project:jira
, write:project-role:jira
...(Show more)Connect app scope required: ADMIN
integer
Requiredarray<string>
array<string>
array<string>
Returned if the request is successful.
Details about the roles in a project.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"user": [
"admin"
]
}`;
const response = await api.asUser().requestJira(route`/rest/api/3/role/{id}/actors`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"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"
}
]
}
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.
manage:jira-configuration
write:project-role:jira
, read:user:jira
, read:group:jira
, read:project-role:jira
, read:project:jira
...(Show more)Connect app scope required: ADMIN
integer
Requiredstring
string
string
Returned if the request is successful.
Details about the roles in a project.
1
2
3
4
5
6
7
8
9
10
11
12
13
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestJira(route`/rest/api/3/role/{id}/actors?user=5b10ac8d82e05b22cc7d4ef5`, {
method: 'DELETE',
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"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"
}
]
}
Rate this page: