Feature #22771

Option to enable email notification for CSV import

Added by Go MAEDA over 2 years ago. Updated about 1 month ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email notifications
Target version:Candidate for next major release
Resolution:

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

History

#1 Updated by Yuichi HARADA 3 months 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 about 1 month ago

  • Target version set to Candidate for next major release

Also available in: Atom PDF