Added status message for initiating Copy Page Hierarchy and Long Task APIs

A new status INITIALIZING_TASK has been added to tasks when initiating Copy Page Hierarchy API. This is to prevent null values in the message field if a task is completed prior to a status being saved.

See the response of fetching long task (Line 13 is where status is being saved):

{
    "id": "9535652",
    "name": {
        "key": "com.atlassian.confluence.api.impl.service.longtasks.BulkPageCopyTaskRunner",
        "args": []
    },
    "elapsedTime": 3708,
    "percentageComplete": 100,
    "successful": true,
    "finished": true,
    "messages": [
        {
            "translation": "{\"status\":{\"key\":\"INITIALIZING_TASK\",\"translation\":null,\"args\":[\"0\"]},\"destinationId\":null,\"totalPageNeedToCopy\":3,\"errors\":[]}",
            "args": []
        }
    ],
    "_links": {
        "base": "",
        "context": "/wiki"
    }
}
5 Likes

Hi @Andrew.Ngo and @SimonKliewer

I’m still seeing this structure in the response to the fetching long task API:

{
  "id":"2160164865",
  "name":{"key":"com.atlassian.confluence.api.impl.service.longtasks.BulkPageCopyTaskRunner","args":[]},
  "elapsedTime":3570,
  "percentageComplete":100,
  "successful":true,
  "finished":true,
  "messages":[{
    "translation":"{\"status\":{\"key\":\"STATUS_COPIED_PAGES\",\"translation\":null,\"args\":[\"4\"]},\"destinationUrl\":\"/spaces/A21/pages/2160001036/Home+page\",\"totalPageNeedToCopy\":4,\"errors\":[]}",
    "args":[]
  }],
  "_links":{"base":"https://jdbevan.atlassian.net/wiki","context":"/wiki"}
}

instead of the fields documented on the docs page or on this CDAC post Add additional fields to “Get long-running task” & “Get long-running tasks” REST API endpoint response objects from a year ago…

Can you provide any insight?