{{sidenavigation.sidenavigationExpandLabel}}
{{getMsg('Help_YouAreHere')}}: {{page.title}} {{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}} {{helpModel.downloadHelpPdfDataStatus}}

Import

Import a single or a list of tasks into the Task Planner. The secondary form of the command is /<taskID>/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/import

Import a list of jobs or a single job. The command requires JSON input in the following form:

{ <TASK DEFINITION> }
 
# or
[
    { <TASK DEFINITION 1> },
    { <TASK DEFINITION 2> },
    { <TASK DEFINITION 3> },
    ...
]

The available properties of the JSON can be found here.

Example Request

# Request
# Use user:password for authorization
POST /api/taskplanner/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/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 the ownerId 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.
i-net CoWork
This application uses cookies to allow login. By continuing to use this application, you agree to the use of cookies.


Help - /import