getTaskAssignments

returns the parsed resource assignments of a specific task from the datastore

array getTaskAssignments(string|number taskId);
taskIdstring|numberthe task id
arrayan array of objects with the resource assignments of the task

Available only in PRO Edition

Example

gantt.getTaskAssignments(5); // -> see details

Related samples

Details

This functionality is available in the PRO edition only.

The getTaskAssignments method is not available if process_resource_assignments is disabled.

The method returns an array with objects as in:

[
    {
        task_id: 5,
        id: 1617254693938, 
        delay: 0, duration: 2, 
        start_date: "03-04-2019 00:00", 
        end_date: "05-04-2019 00:00", 
        mode: "fixedDuration", 
        resource_id: 6, 
        value: 3
    },
    {
        task_id: 5,
        id: 1617254693946, 
        delay: 3, duration: 1, 
        start_date: "06-04-2019 00:00", 
        end_date: "07-04-2019 00:00", 
        mode: "fixedDuration", 
        resource_id: 6, 
        value: 6
    }
]

Each object contains the following properties:

  • task_id - the id of the task
  • id - the id of the assignment
  • delay - the difference between the assignment start date and the task start date
  • duration - the duration of the assignment
  • start_date - the date the assignment is scheduled to start
  • end_date - the date the assignment is scheduled to be completed
  • mode - the calculation mode of the time of the resource assignment: "default"|"fixedDates"|"fixedDuration"
  • resource_id - the id of the resource
  • value - the quantity of the resource assigned to a task

delay, duration, start_date, end_date, id, mode will be populated automatically only when process_resource_assignments is enabled.

See also
Change log

added in v7.1

Back to top