Methods for Working with Tasks (item)

Scope: task

Who can execute the method: any user

Working with the PHP class CTaskItem. Instead of item, you can also use its synonym ctaskitem.

Allowed Fields

Name

Description

Read

Write

Sort

Filter

TITLE

Task title

+

+

+

+

DESCRIPTION

Task description

+

+

DEADLINE

Deadline

+

+

+

START_DATE_PLAN

Planned start date

+

+

+

+

END_DATE_PLAN

Planned end date

+

+

+

PRIORITY

Priority

+

+

+

+

ACCOMPLICES

Participants (user IDs)

+

+

ACCOMPLICE

Participants (field used for filtering)

+

AUDITORS

Observers (user IDs)

+

+

AUDITOR

Observers (field used for filtering)

+

TAGS

Tags (when added — just an array of tags in text form). CTasks::GetList() does not return tag fields. CTaskItem::getInstance()->getTags() returns an array of tag names

+

+

TAG

Tags (field used for filtering)

+

ALLOW_CHANGE_DEADLINE

Flag "Allow the performer (responsible) to change the deadline"

+

+

+

TASK_CONTROL

Flag "Accept work after task completion"

+

+

PARENT_ID

Parent task ID

+

+

+

DEPENDS_ON

ID of the previous task

+

+

+

GROUP_ID

Working group ID

+

+

+

+

RESPONSIBLE_ID

Performer ID

+

+

+

+

TIME_ESTIMATE

Planned labor costs

+

+

+

+

ID

Task ID. Unique within the database

+

+

+

CREATED_BY

Creator ID

+

+

+

+

DESCRIPTION_IN_BBCODE

Is the task description stored in BB codes

+

DECLINE_REASON

Reason for task rejection

+

+

STATUS

Task status

+

+

+

+

RESPONSIBLE_NAME

Performer's first name

+

+

RESPONSIBLE_LAST_NAME

Performer's last name

+

RESPONSIBLE_SECOND_NAME

Performer's middle name

+

DATE_START

Task start date

+

+

+

DURATION_FACT

Time spent on the task in minutes

+

DURATION_PLAN

Planned duration in hours or days

+

+

DURATION_TYPE

Type of measurement unit in planned duration: days, hours, or minutes

+

+

CREATED_BY_NAME

Creator's first name

+

CREATED_BY_LAST_NAME

Creator's last name

+

CREATED_BY_SECOND_NAME

Creator's middle name

+

CREATED_DATE

Task creation date

+

+

+

+

CHANGED_BY

User who last modified the task (user ID)

+

+

+

CHANGED_DATE

Date of the last task modification

+

+

+

+

STATUS_CHANGED_BY

User who changed the task status (user ID)

+

+

+

STATUS_CHANGED_DATE

Date of status change

+

+

CLOSED_BY

Who completed the task

+

CLOSED_DATE

Task completion date

+

+

+

GUID

Globally unique identifier

+

+

MARK

Task rating. Possible values: P (positive) and N (negative)

+

+

+

+

VIEWED_DATE

Date of the last view of the task in the public interface by the current user

+

TIME_SPENT_IN_LOGS

Time spent on the task in seconds

+

FAVORITE

Presence in Favorites for the current user

+

+

+

ALLOW_TIME_TRACKING

Is time tracking enabled for the task

+

+

+

+

ADD_IN_REPORT

Is the task included in the performance report

+

+

+

FORUM_ID

ID of the forum where comments on the task are stored

+

FORUM_TOPIC_ID

ID of the forum topic where comments on the task are stored

+

+

COMMENTS_COUNT

Number of comments on the task

+

SITE_ID

Site ID. By default, this field records the ID of the site where the task is created

+

+

+

SUBORDINATE

Is any participant of the task a subordinate of the current user

+

FORKED_BY_TEMPLATE_ID

ID of the template based on which the task was automatically created. For some old tasks, it may not be set

+

MULTITASK

Was the task created for multiple performers

+

ONLY_ROOT_TASKS

Field that allows selecting only those tasks that either have no parent task or have one, but we do not have access to that parent task

+

MATCH_WORK_TIME

Should the execution dates and deadline always be set during working hours

+

+

+

+

Overview of Methods

Method

Description

task.item.add

Creates a new task

task.item.delete

Deletes a task

task.item.getdata

Returns an array of task data

task.item.getmanifest

Returns a list of methods task.item.* with their descriptions

task.item.list

Returns a list of tasks

task.item.update

Updates task data

task.item.getdescription

Returns the task description

task.item.getfiles

Returns an array with links to files attached to the task

task.item.getdependson

Returns an array with IDs of tasks that the task depends on

task.item.getallowedactions

Returns an array of IDs of allowed actions on the task

task.item.getallowedtaskactionsasstrings

Returns a list of allowed actions on the task

task.item.isactionallowed

Checks if the action is allowed

task.item.delegate

Delegates the task to a new user

task.item.startexecution

Changes the task status to "in progress"

task.item.defer

Changes the task status to "deferred"

task.item.complete

Changes the task status to "completed" or "conditionally completed (awaiting performer control)"

task.item.renew

Changes the task status to "not completed"

task.item.approve

Changes the awaiting control task status to "completed"

task.item.disapprove

Changes the awaiting control task status to "not completed"

task.item.addtofavourite

Adds the task to Favorites

task.item.deletefromfavorite

Removes the task from Favorites

task.item.addfile

Uploads a file to the task

task.item.deletefile

Removes the file attachment from the task

task.logitem.list

Returns the history of task changes

Note

To obtain the tags of a specific task, you need to pass the parameter /rest/task.item.gettags.xml?TASK_ID=3&auth=18tci5kga6v12g8okzm5r26sv0n9is84. The request can be either ID or TASK_ID. It is essential that this parameter is first. The response will return {"result":["TAG1","TAG2","ETC..."]}.