Description | Example | Return Message | Group(s)

NewAssignment

HTTP Request Formats

POST api/task/{taskID}/assignment

To specify the schedule the command shall be sent to:

POST api/schedule/{scheduleName}/task/{taskID}/assignment

Description

The NewAssignment REST API command creates a new assignment for a task in the active/specified schedule.

Request Body

  • Optional ShrinkToTimeslot: An optional boolean parameter: use ShrinkToTimeslot to automatically increase the assignment start times and decrease the assignment stop times so that they do not overrun timeslot boundaries.
  • StartTime: The format is a string of form YYYY/MM/DD_HH:MM:SS or YYYY/MM/DD_HH:MM:SS.fff for the assignment's start time.
  • StopTime: The format is a string of form YYYY/MM/DD_HH:MM:SS or YYYY/MM/DD_HH:MM:SS.fff for the assignment's stop time.
  • AssignmentPossibilityName: The array of strings of resources to use for this assignment.

Examples

Example 1

Creates a new assignment for a task named DemoTask.

POST api/task/DemoTask/assignment

Body:

{

"Start" : "2022/11/21_03:00:00",

"Stop" : "2022/11/21_03:10:00",

"PossibilityResources" : ["resA", "resB"]

}

Example 2

Creates a new assignment for a task named DemoTask and increases the specified Start value and/or decreases the specified Stop value as applicable to fit within the task's timeslots.

POST api/task/DemoTask/assignment

Body:

{

"ShrinkToTimeslot" : true,

"Start" : "2022/11/21_03:00:00",

"Stop" : "2022/11/21_03:10:00",

"PossibilityResources" : ["resA", "resB"]

}

Return Message

If successful, a standard successful HTTP response code as well as the new assignment's ID shall be returned  .

Group Membership

This command belongs to the following group(s):

Scheduler

Version

12.5