Feature #22771

Option to send email notifications while importing issues from CSV files

Added by Go MAEDA over 3 years ago. Updated 6 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Email notifications
Target version:4.1.0
Resolution:Fixed

Description

All email notifications are disabled for CSV import (source:trunk/app/models/issue_import.rb@15238#L65). Since no notifications are sent, assignees can't recognize issues which created and assigned by CSV importer unless they see issues list on screen.

I think it would be nice if users can choose either disable or enable email notifications when performing CSV import operation.

email-notification-option-for-csv-import.png (25 KB) Go MAEDA, 2016-05-09 06:24

22771-add-option-email-notification.patch Magnifier (4.04 KB) Yuichi HARADA, 2018-10-26 08:34

22771-another-label.diff Magnifier (3.88 KB) Go MAEDA, 2019-05-09 11:34

label_import_notifications@2x.png (18.9 KB) Go MAEDA, 2019-05-09 11:34

22771-another-label-v2.diff Magnifier (3.88 KB) Go MAEDA, 2019-05-09 16:30

Associated revisions

Revision 18153
Added by Go MAEDA 6 months ago

Option to send email notifications while importing issues from CSV files (#22771).

Patch by Yuichi HARADA.

Revision 18154
Added by Go MAEDA 6 months ago

Update locales (#22771).

History

#1 Updated by Yuichi HARADA about 1 year ago

+1
I do not know that I added issues because there is no notifications.

I made a patch, and attach it.

diff --git a/app/models/import.rb b/app/models/import.rb
index d2c53baac..01fe72d47 100644
--- a/app/models/import.rb
+++ b/app/models/import.rb
@@ -66,7 +66,8 @@ class Import < ActiveRecord::Base
       'separator' => separator,
       'wrapper' => wrapper,
       'encoding' => encoding,
-      'date_format' => date_format
+      'date_format' => date_format,
+      'mail_notification' => '0'
     )
   end

diff --git a/app/models/issue_import.rb b/app/models/issue_import.rb
index ad04c0be5..a2925be32 100644
--- a/app/models/issue_import.rb
+++ b/app/models/issue_import.rb
@@ -77,7 +77,7 @@ class IssueImport < Import
   def build_object(row, item)
     issue = Issue.new
     issue.author = user
-    issue.notify = false
+    issue.notify = !!ActiveRecord::Type::Boolean.new.cast(settings['mail_notification'])

     tracker_id = nil
     if tracker
diff --git a/app/views/imports/settings.html.erb b/app/views/imports/settings.html.erb
index 6edfb10af..be504d30d 100644
--- a/app/views/imports/settings.html.erb
+++ b/app/views/imports/settings.html.erb
@@ -21,6 +21,12 @@
       <label for="import_settings_date_format"><%= l(:setting_date_format) %></label>
       <%= select_tag 'import_settings[date_format]', options_for_select(date_format_options, @import.settings['date_format']) %>
     </p>
+    <hr/>
+    <p>
+      <label for="import_settings_mail_notification"><%= l(:field_mail_notification) %></label>
+      <%= hidden_field_tag 'import_settings[mail_notification]', '0', :id => nil %>
+      <%= check_box_tag 'import_settings[mail_notification]', '1', "#{@import.settings['mail_notification']}" == '1' %>
+    </p>
   </fieldset>
   <p><%= submit_tag l(:label_next).html_safe + " &#187;".html_safe, :name => nil %></p>
 <% end %>

#2 Updated by Go MAEDA 12 months ago

  • Target version set to Candidate for next major release

#3 Updated by Go MAEDA 6 months ago

I have slightly modified the patch. Now the text of the label for the checkbox has the same style as label_project_copy_notifications.

  label_project_copy_notifications: Send email notifications during the project copy
  label_import_notifications: Send email notifications during the import

#4 Updated by Go MAEDA 6 months ago

#5 Updated by Go MAEDA 6 months ago

  • Subject changed from Option to enable email notification for CSV import to Option to send email notifications while importing issues from CSV files
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thanks.

Also available in: Atom PDF