]> source.dussan.org Git - redmine.git/commitdiff
Add `updated_on` and `updated_by` fields to Issues API journal response (#40449).
authorGo MAEDA <maeda@farend.jp>
Mon, 27 May 2024 07:41:57 +0000 (07:41 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 27 May 2024 07:41:57 +0000 (07:41 +0000)
Contributed by Thomas Hoffmann (@ThomasHo).

git-svn-id: https://svn.redmine.org/redmine/trunk@22846 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/issues/show.api.rsb
test/integration/api_test/issues_test.rb

index 6f23ca4b474740ed21702c933b1e94bbff578a19..2c341163ae10eab3e20ead34db9a80faa8692665 100644 (file)
@@ -59,6 +59,8 @@ api.issue do
         api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil?
         api.notes journal.notes
         api.created_on journal.created_on
+        api.updated_on journal.updated_on
+        api.updated_by(:id => journal.updated_by.id, :name => journal.updated_by.name) unless journal.updated_by.nil?
         api.private_notes journal.private_notes
         api.array :details do
           journal.visible_details.each do |detail|
index 05d40647c2ad4bb7b418b32861261848565902b7..142dc86b834ea3a6800f666c3ebb9bb04a6de5d9 100644 (file)
@@ -242,6 +242,8 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
 
     assert_select 'issue journals[type=array]' do
       assert_select 'journal[id="1"]' do
+        assert_select 'updated_on', :text => Issue.find(1).journals[0].updated_on.iso8601
+        assert_select 'updated_by[id="1"][name="Redmine Admin"]'
         assert_select 'private_notes', :text => 'false'
         assert_select 'details[type=array]' do
           assert_select 'detail[name=status_id]' do