Methods for Working with Tasks (item)
Scope:
taskWho 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). |
+ |
+ |
||
|
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: |
+ |
+ |
+ |
+ |
|
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 |
|
Creates a new task |
|
|
Deletes a task |
|
|
Returns an array of task data |
|
|
Returns a list of methods |
|
|
Returns a list of tasks |
|
|
Updates task data |
|
|
Returns the task description |
|
|
Returns an array with links to files attached to the task |
|
|
Returns an array with IDs of tasks that the task depends on |
|
|
Returns an array of IDs of allowed actions on the task |
|
|
Returns a list of allowed actions on the task |
|
|
Checks if the action is allowed |
|
|
Delegates the task to a new user |
|
|
Changes the task status to "in progress" |
|
|
Changes the task status to "deferred" |
|
|
Changes the task status to "completed" or "conditionally completed (awaiting performer control)" |
|
|
Changes the task status to "not completed" |
|
|
Changes the awaiting control task status to "completed" |
|
|
Changes the awaiting control task status to "not completed" |
|
|
Adds the task to Favorites |
|
|
Removes the task from Favorites |
|
|
Uploads a file to the task |
|
|
Removes the file attachment from the task |
|
|
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..."]}.