This resource represents votes cast by users on an issue. Use it to get details of votes on an issue as well as cast and withdrawal votes.
Returns details about the votes on an issue.
This operation requires the Allow users to vote on issues option to be ON. This option is set in General configuration for Jira. See Configuring Jira application options for details.
This operation can be accessed anonymously.
Permissions required:
Note that users with the necessary permissions for this operation but without the View voters and watchers project permissions are not returned details in the voters
field.
read:jira-work
read:issue.vote:jira
, read:user:jira
, read:application-role:jira
, read:avatar:jira
, read:group:jira
Connect app scope required: READ
string
RequiredReturned if the request is successful.
The details of votes on an issue.
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/issue/{issueIdOrKey}/votes`, {
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
16
17
18
19
20
21
22
{
"hasVoted": true,
"self": "https://your-domain.atlassian.net/rest/api/issue/MKY-1/votes",
"voters": [
{
"accountId": "5b10a2844c20165700ede21g",
"accountType": "atlassian",
"active": false,
"avatarUrls": {
"16x16": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
"24x24": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
"32x32": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
"48x48": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
},
"displayName": "Mia Krystof",
"key": "",
"name": "",
"self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
}
],
"votes": 24
}
Adds the user's vote to an issue. This is the equivalent of the user clicking Vote on an issue in Jira.
This operation requires the Allow users to vote on issues option to be ON. This option is set in General configuration for Jira. See Configuring Jira application options for details.
Permissions required:
write:jira-work
write:issue.vote:jira
Connect app scope required: WRITE
string
RequiredReturned if the request is successful.
any
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/issue/{issueIdOrKey}/votes`, {
method: 'POST',
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Deletes a user's vote from an issue. This is the equivalent of the user clicking Unvote on an issue in Jira.
This operation requires the Allow users to vote on issues option to be ON. This option is set in General configuration for Jira. See Configuring Jira application options for details.
Permissions required:
write:jira-work
write:issue.vote:jira
Connect app scope required: DELETE
string
RequiredReturned 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/issue/{issueIdOrKey}/votes`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Rate this page: