Returns information about all active long-running tasks (e.g. space export), such as how long each task has been running and the percentage of each task that has completed.
Permissions required: Permission to access the Confluence site ('Can use' global permission).
read:content.metadata:confluence
Connect app scope required: READ
string
integer
integer
Returned if the requested tasks are returned.
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().requestConfluence(route`/wiki/rest/api/longtask`, {
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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"results": [
{
"ari": "<string>",
"id": "<string>",
"name": {
"key": "<string>",
"args": [
{}
]
},
"elapsedTime": 2154,
"percentageComplete": 2154,
"successful": true,
"finished": true,
"messages": [
{
"translation": "<string>",
"args": [
"<string>"
]
}
],
"status": "<string>",
"errors": [
{
"translation": "<string>",
"args": [
"<string>"
]
}
],
"additionalDetails": {
"destinationId": "<string>",
"destinationUrl": "<string>",
"totalPageNeedToCopy": 2154,
"additionalProperties": "<string>"
}
}
],
"start": 2154,
"limit": 2154,
"size": 2154,
"_links": {}
}
Returns information about an active long-running task (e.g. space export), such as how long it has been running and the percentage of the task that has completed.
Permissions required: Permission to access the Confluence site ('Can use' global permission).
read:confluence-space.summary
read:content.metadata:confluence
Connect app scope required: READ
string
RequiredReturned if the requested task is returned.
Same as LongTaskStatus but with _links
property.
Status keys:
ERROR_UNKNOWN
- Generic errorERROR_LOCK_FAILED
- Could not get the lock on destination spaceERROR_RELINK
- Error when relink pages/attachmentsERROR_COPY_PAGE
- Error while copying 1 pageWARN_RENAME_PAGE
- Warning page is rename during copyWARN_IGNORE_COPY_PERMISSION
- Warning could not copy permissionWARN_IGNORE_COPY_ATTACHMENT
- Warning could not copy attachmentWARN_IGNORE_DELETE_PAGE
- Warning ignoring delete of a non agreed on pageSTATUS_COPIED_PAGES
- Message total pages are copiedSTATUS_COPYING_PAGES
- Message copy pagesSTATUS_RELINK_PAGES
- Message relink pages/attachmentsSTATUS_DELETING_PAGES
- Message delete pagesSTATUS_DELETED_PAGES
- Message total pages are deletedSTATUS_MOVING_PAGES
- Message move pagesWARN_IGNORE_VIEW_RESTRICTED
- Permission changed - view restrictedWARN_IGNORE_EDIT_RESTRICTED
- Permission changed - edit restrictedINITIALIZING_TASK
- Message when initializing taskUNKNOWN_STATUS
- Message when status is unknown1
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().requestConfluence(route`/wiki/rest/api/longtask/{id}`, {
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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"ari": "<string>",
"id": "<string>",
"name": {
"key": "<string>",
"args": [
{}
]
},
"elapsedTime": 2154,
"percentageComplete": 2154,
"successful": true,
"finished": true,
"messages": [
{
"translation": "<string>",
"args": [
"<string>"
]
}
],
"_links": {},
"status": "<string>",
"errors": [
{
"translation": "<string>",
"args": [
"<string>"
]
}
],
"additionalDetails": {
"destinationId": "<string>",
"destinationUrl": "<string>",
"totalPageNeedToCopy": 2154,
"additionalProperties": "<string>"
}
}
Rate this page: