Tracking time in Codebase allows you to keep track of how long you spend working on a specific project. This can be viewed on a daily, weekly, monthly or custom-range basis through the interface. Each project can contain an unlimited number of "time sessions". A time session itself is made up from some text describing what you did in the session and a number of minutes spent.
We support filtering with the following optional params:
userthe ID of the user
to- for time sessions that occurred to this date
fromfor time sessions that occurred from date
|All time session for a project||GET||/project/time_sessions|
|Time sessions added today||GET||/project/time_sessions/day|
|Time sessions added this week||GET||/project/time_sessions/week|
|Time sessions added this month||GET||/project/time_sessions/month|
|Creating a new session||POST||/project/time_sessions|
|Show an existing session||GET||/project/time_sessions/session_id|
|Update an existing session||PUT||/project/time_sessions/session_id|
|Delete a session||DELETE||/project/time_sessions/session_id|
The XML output below shows the properties which are returned by default when accessing ticket details.
<time-session> <id type="integer">1234</id> <summary>Worked on the awesome time tracking in Codebase</summary> <minutes type="integer">180</minutes> <session-date type="date">2009-09-05</session-date> <user-id type="integer">1234</user-id> <created-at type="datetime">2013-09-10T18:45:44Z</created-at> <updated-at type="datetime">2013-09-10T18:45:44Z</updated-at> </time-session>
idthe unique ID for this session
summaryRequired details entered about this time session. Sessions entered through tickets or in commit messages will contain information on this space.
minutesRequired the number of whole minutes which should be recorded.
user-idthe ID of the user
session-datethe date of the session took place. Should be entered in the format:
to- for time sessions that occurred to this date (optional)
fromfor time sessions that occurred from date (optional)
Creating a new time session
When adding a new time session, you should simply send the
minutes fields. The user ID will be set by default to you based on your API key, otherwise you can specify another user by passing a
user_id param. The
session-date will be set to today unless one is provided.