Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Imports a list of time entries in different states.

Function name

import-time-entries

Parameters

  • data (Required). It is an array of time entry fields. The details of the fields are as follows:

creator_id (Required): The user ID or name of the user on whose behalf the time entry is being submitted.
for_date (Required): Date. The date for this time entry.
hours_worked (Required): Float. The number of hours.
task_id (Required). Integer: The task for which this time entry is being filled.
time_code_id (Required): The time code ID or Name for this time entry.
user_comments (Optional): The comments entered by user for this time entry.
state (Optional). Integer: The state in which the time-entry needs to be imported. The state needs to be an integer and one of the following: 0 - Saved, 1 - Sent for Approval, 2 - Rejected, 3 - Approved, 6-Invoice. Default is 'Sent for Approval'.
bill_rate (Optional): The rate at which the time-entry needs to be billed.
cost_rate (Optional): The rate at which the cost of the time-entry will be calculated.
is_billable (Optional): If the time-entry needs to be marked as billable. The value needs to be True or False.
is_costable (Optional): If the time-entry needs to be marked as billable. The value needs to be True or False.
approver_id: Required field if the time-entry is imported in approved (3) state. It can be an ID or the Name.
approver_commentscomments (Optional): The comments entered while approving.
invoiced_by_id: Required field if the time-entry is imported in invoiced (6) state. It can be an ID or the Name.
rejected_by_id: Required field if the time-entry is imported in rejected (2) state. It can be an ID or the Name.
rejection_comments (Optional): The comments entered  while rejecting. 


Return values

time_entries_id


When your data format is XML, you should post something like this :

Code Block
languagejava
<data>
  <item>
      <task_id>876925</task_id>
      <creator_id>Mary Jane</creator_id>
	  <state>1</state>
      <for_date>2014-11-01</for_date>	  
      <user_comments>Had the first meeting with client representative today.</user_comments>
	  <hours_worked>1</hours_worked>
	  <time_code_id>Default</time_code_id>  
	  <is_billable>true</is_billable>
	  <is_costable>false</is_costable>
	</item> 

    <item>
      <task_id>9201093</task_id>
      <creator_id>Eva Cross</creator_id>
	  <state>2</state>
      <rejected_by_id>Mary Jane</rejected_by_id>
      <for_date>2014-11-01</for_date>
	  <hours_worked>4</hours_worked>
	  <time_code_id>Default</time_code_id>	  	  
	  <is_billable>true</is_billable>
	  <is_costable>true</is_costable>	  
      <bill_rate>100</bill_rate>
	  <cost_rate>50</cost_rate>
	</item> 
</data>

...


In case of JSON, you should submit an array of objects with the same properties. 

...