Skip to content

Remove email participants quick action

What does this MR do and why?

Solves issue #225310 (closed)

This feature is hidden behind the feature flag 🎏 issue_email_participants.

Based on Community contribution Draft: Remove multiple email partcipants (!103074 - closed) by @ArkaprabhaChakraborty

Adds the quick action /remove_email which is the counterpart for /invite_email. They are used to manage external participants on an issue. Each public comment will generate Service Desk emails to all external participants on an issue.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Quick action in editor

image

System note after execution (with one email)

image

System note after execution (with multiple emails)

image

How to set up and validate locally

  1. Select a project and enable the feature flag for issue_email_participants.
    project = Project.find(7)
    
    Feature.enable(:issue_email_participants, project)
  2. Go to the projects issue list and select an issue or create a new one http://127.0.0.1:3000/flightjs/Flight/-/issues
  3. Go to the issue detail page and write a comment that adds an external participant like so:
    /invite_email user@example.com
  4. See that a system note has been added.
  5. Now remove that participant:
    /remove_email user@example.com
  6. See that a system note has been added.
  7. Now experiment with adding and removing external participants.
  8. (Optional) Disable the feature flag in the console:
    Feature.disable(:issue_email_participants, project)

Database

The /remove_email quickaction removes up to 6 emails from the issue.

Find emails of issue

SELECT "issue_email_participants".* FROM "issue_email_participants"
WHERE "issue_email_participants"."issue_id" = 658 AND
(LOWER("issue_email_participants"."email") IN (LOWER('user@example.com')))
Index Scan using index_issue_email_participants_on_issue_id_and_lower_email on issue_email_participants  (cost=0.43..3.45 rows=1 width=59)  
  Index Cond: ((issue_id = 658) AND (lower(email) = 'user@example.com'::text)) 

Delete all

DELETE FROM "issue_email_participants" 
WHERE "issue_email_participants"."issue_id" = 658 AND
(LOWER("issue_email_participants"."email") IN (LOWER('user@example.com')))
Delete on issue_email_participants  (cost=0.43..3.45 rows=0 width=0)  
  ->  Index Scan using index_issue_email_participants_on_issue_id_and_lower_email on issue_email_participants  (cost=0.43..3.45 rows=1 width=6)  
        Index Cond: ((issue_id = 658) AND (lower(email) = 'user@example.com'::text))

MR acceptance checklist

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

Edited by Marc Saleiko

Merge request reports