Skip to content

Create a note when replied to the email creating the service desk issue

Jarka Košanová requested to merge 337608-multiple-issues-sd-prevention into master

What does this MR do and why?

Right now, when a user sends an email to create a service desk issue and put another person in cc, when that person responds to the email (and includes service desk in recipients) a new issue is created.

This MR changes that and instead of creating a new issue a new comment is added to the issue the first user had created with their email.

How to set up and validate locally

  1. Configure incoming emails
  2. Update gitlab-mail_room gem to version 0.0.13 in https://gitlab.com/gitlab-org/gitlab/-/blob/master/Gemfile#L442
  3. Run mailroom bundle exec mail_room -c './config/mail_room.yml'
  4. Go to project settings and find support desk address (eg. http://127.0.0.1:3000/flightjs/Flight/edit)
  5. Send an email to that address, cc another email that you have access to
  6. Check the project issues, a new issue should be created (eg. http://127.0.0.1:3000/flightjs/Flight/-/issues)
  7. Go to the second email account, a new email should arrive
  8. Respond to that email, don't forget to include support desk email among the recipients
  9. Go to the previously created issue, a new comment should be created
  10. Check no other issue has been created

Database

Migration up

== 20211110092710 CreateIssueEmails: migrating ================================
-- create_table(:issue_emails, {})
-- quote_column_name(:email_message_id)
   -> 0.0000s
   -> 0.0136s
== 20211110092710 CreateIssueEmails: migrated (0.0137s) =======================

Migration down

== 20211110092710 CreateIssueEmails: reverting ================================
-- drop_table(:issue_emails)
   -> 0.0033s
== 20211110092710 CreateIssueEmails: reverted (0.0034s) =======================

Possible problems

There are problems with setting incoming emails. In order to make that working, need to update the MailRoom gem version in the Gemfile, MR not merged yet:

  1. Cherry-pick the mailroom gem update git cherry-pick 8103d700642bedf24ddd76bf03ccd895096284c5

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #337608 (closed)

Edited by Jarka Košanová

Merge request reports

Loading