プロジェクト

全般

プロフィール

Vote #68547

完了

REST API for time tracker.

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
開始日:
2010/11/03
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
20
issue_org_id:
6823
author_id:
23088
assigned_to_id:
0
comments:
10
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

journals

any chance to have it? :(
--------------------------------------------------------------------------------
I think it won't be part of 1.1 but this is a must have.
--------------------------------------------------------------------------------
I think so !

I really need it, even if it just add a time entry and nothing more.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Added in r4461.
--------------------------------------------------------------------------------
I have a problem using it :

Class with activeresource
<pre>
# Timelog model rbot side
class ::TimeEntry < ::ActiveResource::Base
self.element_name = 'time_entry'
self.collection_name = 'time_entries'
self.proxy = ''
self.timeout = 5
end
</pre>

Code calling it
<pre>
::TimeEntry.site ="http://myredmine"
::TimeEntry.user = "myuser"
::TimeEntry.password = "mypass"
newtimelog = TimeEntry.new(:issue_id => 7, :comments => "up", :activity_id =>9, :hours => "3h30")
if newtimelog.save
m.reply "it's ok"
else
m.reply "it failed"
end
</pre>

I get an error on this line : "if newtimelog.save"
<pre>
undefined method `path' for nil:NilClass

["/usr/lib/ruby/1.8/active_resource/base.rb:410:in `prefix'", "/usr/lib/ruby/1.8/active_resource/base.rb:420:in `prefix_source'", "/usr/lib/ruby/1.8/active_resource/base.rb:684:in `prefix_parameters'", "/usr/lib/ruby/1.8/active_resource/base.rb:699:in `split_options'", "/usr/lib/ruby/1.8/active_resource/base.rb:697:in `each'", "/usr/lib/ruby/1.8/active_resource/base.rb:697:in `split_options'", "/usr/lib/ruby/1.8/active_resource/base.rb:1141:in

...
</pre>

The new updated method for Issue use the same kind of routes and work very well.

I think i'm right on the way to use it, but i may be wrong and it could come from my code..

--------------------------------------------------------------------------------
I can not reproduce this problem and it happens on the client side.
The following code works just fine:

<pre>
class TimeEntry < ActiveResource::Base
self.site = 'http://localhost:3000'
self.user = 'xxx'
self.password = 'xxxxxx'
end

time = TimeEntry.new(:issue_id => 1, :hours => 2.3, :activity_id => 8, :spent_on => Date.today)
if time.save
puts time.id
else
pp time.errors
end
</pre>

Please open another ticket if there is someting wrong with the API.
--------------------------------------------------------------------------------
Can you with this api get time entries for specific day (today, yesterday, 2011-02-01), month (this, last) or between range of dates?
--------------------------------------------------------------------------------
Never mind - you can, just use from and to parameters.
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリREST API_32 にセット
  • 対象バージョン1.1.0_20 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0