]> source.dussan.org Git - redmine.git/commitdiff
Show parent issues in notification email (#34302).
authorGo MAEDA <maeda@farend.jp>
Wed, 1 Mar 2023 03:46:53 +0000 (03:46 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 1 Mar 2023 03:46:53 +0000 (03:46 +0000)
Patch by Yuichi HARADA.

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

app/helpers/issues_helper.rb
app/models/issue.rb
test/unit/mailer_test.rb

index 9fcd480a5765934e439bc6061afc6361fab8af73..9a40b01882cd52b735babd024edcd032af0062a4 100644 (file)
@@ -445,7 +445,7 @@ module IssuesHelper
 
   def email_issue_attributes(issue, user, html)
     items = []
-    %w(author status priority assigned_to category fixed_version start_date due_date).each do |attribute|
+    %w(author status priority assigned_to category fixed_version start_date due_date parent_issue).each do |attribute|
       if issue.disabled_core_fields.grep(/^#{attribute}(_id)?$/).empty?
         attr_value = (issue.send attribute).to_s
         next if attr_value.blank?
index 88c808321aed7075f99a1c4bcade5d58adcb87eb..a0c2006ad8f8f7a0675bce6898de44f6c9fce9fd 100644 (file)
@@ -1502,6 +1502,8 @@ class Issue < ActiveRecord::Base
     end
   end
 
+  alias :parent_issue :parent
+
   def set_parent_id
     self.parent_id = parent_issue_id
   end
index 99d67423f00c5e4feb3fd87f2525a0c8c76fc6cc..07b7d27aeea394ec6ec14d00fc34cdcb7157468c 100644 (file)
@@ -658,7 +658,7 @@ class MailerTest < ActiveSupport::TestCase
     ActionMailer::Base.deliveries.clear
     with_settings :notified_events => %w(issue_added) do
       cf = IssueCustomField.generate!
-      issue = Issue.generate!
+      issue = Issue.generate!(:parent => Issue.find(1))
       Mailer.deliver_issue_add(issue)
 
       assert_not_equal 0, ActionMailer::Base.deliveries.size
@@ -667,6 +667,7 @@ class MailerTest < ActiveSupport::TestCase
       assert_mail_body_match /^\* Author: /, mail
       assert_mail_body_match /^\* Status: /, mail
       assert_mail_body_match /^\* Priority: /, mail
+      assert_mail_body_match /^\* Parent task: /, mail
 
       assert_mail_body_no_match /^\* Assignee: /, mail
       assert_mail_body_no_match /^\* Category: /, mail