{{getMsg('Help_YouAreHere')}}:
/
{{page.title}}
{{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}}
{{helpModel.downloadHelpPdfDataStatus}}
Import of specific Task ID
Import a single task into the Task Planner denoted by its task id. The primary form of the command is /import.
The imported form can be derived from the Export Command. A single task definition can be obtained using the view command for a task.
POST /api/taskplanner/<TaskID>/import
Import a single task. The command requires JSON input in the following form:
{ <TASK DEFINITION> }
The available properties of the JSON can be found here.
Example Request
# Request # Use user:password for authorization POST /api/taskplanner/4w8yavnk046debwrwkcg4dbqh/import HTTP/1.1 Content-Type: application/json Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u <JSON INPUT> # Response - List of Tasks HTTP/1.1 200 OK Content-Type: application/json Content-Length: <LENGTH>
Application Example
# Shell access using curl curl -Lsu "username:password" \ --request POST --url "http://127.0.0.1:9000/api/taskplanner/4w8yavnk046debwrwkcg4dbqh/import" \ --header 'content-type: application/json' \ --data '<JSON INPUT>'
Notes about importing tasks
The following notes should help to understand some common errors while importing tasks:
-
importing a task without an
id
field will result in a new task for the logged in user -
importing a task with an
id
field (or using the<taskID>/import
syntax) will result in an update of an existing task. If no such task exists, an error will be returned.-
updating a task requires the field
ownerId
to be set and match theownerId
of the existing task -
if the task that should be updated does not belong to the currently logged in user, the user has to have Task Planner Administration privileges.
-