Project

General

Profile

Actions

Feature #22771

closed

Option to send email notifications while importing issues from CSV files

Added by Go MAEDA almost 8 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Email notifications
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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.


Files

Actions #1

Updated by Yuichi HARADA over 5 years 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 %>

Actions #2

Updated by Go MAEDA over 5 years ago

  • Target version set to Candidate for next major release
Actions #3

Updated by Go MAEDA almost 5 years 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

Actions #5

Updated by Go MAEDA almost 5 years 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.

Actions

Also available in: Atom PDF