Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions docs/resources/time_entry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ create
Creates new time entry resource with given fields and saves it to the Redmine.

:param integer issue_id or project_id: (required). The issue id or project id to log time on.
:param integer hours: (required). The number of spent hours.
:param hours: (required). The number of spent hours.
:param spent_on: (optional). The date the time was spent (current date if not set).
:type hours: int or float
:type spent_on: string or date object
:param integer activity_id: (optional). The id of the time activity. This parameter is required unless
a default activity is defined in Redmine.
Expand All @@ -33,7 +34,7 @@ create

.. code-block:: python

>>> time_entry = redmine.time_entry.create(issue_id=123, spent_on='2014-01-14', hours=3, activity_id=10, comments='hello')
>>> time_entry = redmine.time_entry.create(issue_id=123, spent_on='2014-01-14', hours=3.5, activity_id=10, comments='hello')
>>> time_entry
<redmine.resources.TimeEntry #12345>

Expand All @@ -55,7 +56,7 @@ new
>>> time_entry = redmine.time_entry.new()
>>> time_entry.issue_id = 123
>>> time_entry.spent_on = date(2014, 1, 14)
>>> time_entry.hours = 3
>>> time_entry.hours = 3.5
>>> time_entry.activity_id = 10
>>> time_entry.comments = 'hello'
>>> time_entry.save()
Expand Down Expand Up @@ -157,16 +158,17 @@ update

:param integer resource_id: (required). Time entry id.
:param integer issue_id or project_id: (optional). The issue id or project id to log time on.
:param integer hours: (optional). The number of spent hours.
:param hours: (optional). The number of spent hours.
:param spent_on: (optional). The date the time was spent.
:type hours: int or float
:type spent_on: string or date object
:param integer activity_id: (optional). The id of the time activity.
:param string comments: (optional). Short description for the entry (255 characters max).
:return: True

.. code-block:: python

>>> redmine.time_entry.update(1, issue_id=123, spent_on='2014-01-14', hours=3, activity_id=10, comments='hello')
>>> redmine.time_entry.update(1, issue_id=123, spent_on='2014-01-14', hours=3.5, activity_id=10, comments='hello')
True

save
Expand All @@ -186,7 +188,7 @@ save
>>> time_entry = redmine.time_entry.get(1)
>>> time_entry.issue_id = 123
>>> time_entry.spent_on = date(2014, 1, 14)
>>> time_entry.hours = 3
>>> time_entry.hours = 3.5
>>> time_entry.activity_id = 10
>>> time_entry.comments = 'hello'
>>> time_entry.save()
Expand Down