TimeEntries
Create, update, delete, and query from TimeEntries table
Table Specific Information
Select
Following is an example to select all entries from TimeEntries table:
SELECT * FROM TimeEntries
The API allows only a subset of columns to be used as filter criteria in the WHERE clause. The following columns can be used:
- AgentId
- Billable
- ExecutedAt
Insert
TicketId is mandatory to INSERT into the TimeEntries table. For instance:
INSERT INTO TimeEntries (TicketId, Note, AgentId) VALUES ('255', 'Invoice Information', '122')
Note:
- The TicketId is required field to INSERT into TimeEntries table.
- Default value for Billable is true.
- If the TimeSpent attribute and the TimerRunning attribute are not specified, then the TimerRunning attribute will automatically be set to 'true'.
- If the StartTime is specified and the TimerRunning attribute is not specified, then the TimerRunning attribute will automatically be set to 'true'.
- The StartTime cannot be greater than the current time.
- The StartTime cannot be given in the query if the TimerRunning attribute is set to 'false'
Update
Following is an example of how to update TimeEntries table:UPDATE TimeEntries SET Billable = 'true' WHERE Id = 786
Note:
- The StartTime cannot be updated if the timer is already running.
- The StartTime cannot be be updated unless the timer_running attribute is updated from 'true' to 'false'.
- The StartTime cannot be greater than the current time.
- The TimerRunning attribute cannot be set to the same value as before.
- The AgentId cannot be updated if the timer is already running.
Delete
Following is an example of how to delete from the TimeEntries table:
DELETE FROM TimeEntries WHERE Id = 786
Columns
Name | Type | ReadOnly | Description |
Id [KEY] | Bigint | False |
Unique ID of the time entry. |
AgentId | Bigint | False |
The ID of the agent to whom this time-entry is associated. |
Billable | Boolean | False |
Set to true if the time entry is billable. |
ExecutedAt | Datetime | False |
Time at which this time-entry was added/created. |
Note | String | False |
Description of the time entry. |
StartTime | Datetime | False |
The time at which the time-entry is added or the time of the last invoked |
TicketId | Bigint | True |
The ID of the ticket to which this time entry is associated. |
TimeSpent | String | False |
The duration in hh:mm format. |
TimerRunning | Boolean | False |
True if the timer is currently running. |
CreatedAt | Datetime | True |
Time Entry created timestamp. |
UpdatedAt | Datetime | True |
Time Entry updated timestamp. |