This resource represents a long-running asynchronous tasks. Use it to obtain details about the progress of a long-running task or cancel a long-running task.
Returns the status of a long-running asynchronous task.
When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the operation that created the task for details. Task details are not permanently retained. As of September 2019, details are retained for 14 days although this period may change without notice.
Deprecation notice: The required OAuth 2.0 scopes will be updated on June 15, 2024.
read:jira-work
Permissions required: either of:
read:jira-work
Connect app scope required: NONE
string
RequiredReturned if the request is successful.
Details about a task.
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/task/{taskId}`, {
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
{
"self": "https://your-domain.atlassian.net/rest/api/3/task/1",
"id": "1",
"description": "Task description",
"status": "COMPLETE",
"result": "the task result, this may be any JSON",
"submittedBy": 10000,
"progress": 100,
"elapsedRuntime": 156,
"submitted": 1501708132800,
"started": 1501708132900,
"finished": 1501708133000,
"lastUpdate": 1501708133000
}
Cancels a task.
Permissions required: either of:
write:jira-work
delete:async-task:jira
Connect app scope required: NONE
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/task/{taskId}/cancel`, {
method: 'POST',
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Rate this page: