Participants in Service Desk
### Problem to solve
Currently, the service desk will monitor incoming emails and create issues. When comments are made on those issues, email participants will receive updates via email.
However, it is currently not possible to include more than one email participant. This limitation effectively prevents the Service Desk from initiating a conversation with multiple customers/team members that may also be interested in the issue.
Participants may be CC'd in the original email, they may be added directly by a support staff, they may be included when the service desk issue is created via the API.
### JTBD
- When responding to a ticket, **an agent** can include new email participants that weren't originally included in the conversation, so that the relevant party can be informed
- When using the GitLab API to create an issue, **an application developer** can include multiple email addresses so that all the relevant participants are included
- When responding to a service ticket via email, **a requester** can add additional ccs so that my colleagues are informed with what is happening with the request
- When creating a ticket on behalf of customers, **an agent** would like to be able to include multiple email addresses so that all the relevant participants are included.
### Feature Roadmap
<table>
<tr>
<th>Minimal</th>
<th>Viable (17.0)</th>
<th>Complete (TBD)</th>
</tr>
<tr>
<td>
* [x] :white_check_mark: External participants receive Service Desk emails
* [x] :white_check_mark: Implement [max external participants](https://gitlab.com/gitlab-org/gitlab/-/issues/299940 "Implement limit of 10 for external participants in a single Service Desk issue") so we can lower risk profile
* [x] :white_check_mark: [Add `/remove_email` quick action](https://gitlab.com/gitlab-org/gitlab/-/issues/225310 "Service Desk: Remove external email participants to service desk via quick action")
* [x] :white_check_mark: [Add documentation](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/149327 "Adds documentation for external participants")
* [x] :white_check_mark: [Don't send Service Desk emails on comments from external participants to themselves](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141131 "Unsubscribe individual issue email participants from issue") (right now only comments from external author don't get sent to them)
</td>
<td>
* [x] :white_check_mark: [External participants receive Service Desk emails and can opt-out](https://gitlab.com/gitlab-org/gitlab/-/issues/299261 "Manually added external participants can self opt-out")
* [x] :white_check_mark: [Obfuscate email addresses of external participants in system notes](https://gitlab.com/gitlab-org/gitlab/-/issues/456109 "Obfuscate external participant's email address in system notes")
* [x] :white_check_mark: [Include CCs](https://gitlab.com/gitlab-org/gitlab/-/issues/4652 "Service Desk should add emails in the To line and CC line as external participants")
* [x] Release [/invite_email](https://gitlab.com/groups/gitlab-org/-/epics/10636 "Service Desk: Add external email participants to service desk via quick action") according to rollout plan
* [x] :white_check_mark: [Add system note when external participant unsubscribes](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142287 "Draft: Add system note when external participant unsubscribes")
* [x] :white_check_mark: [Rename `/invite_email` quick action to `/add_email` quick action.](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151776)
* [x] :white_check_mark: [Add release post item](https://gitlab.com/gitlab-org/gitlab/-/issues/460480)
* [x] :white_check_mark: [Feature flag defaults to `true`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152083)
</td>
<td>
* [ ] Improve error messages for quick actions
* [ ] Add source/context to external participant system note (`Added user@example.com from CC header`, `Removed user@example.com because they unsubscribed`)
* [x] :white_check_mark: [External participants receive an initial subscription notification `new_participant`](https://gitlab.com/gitlab-org/gitlab/-/issues/299261)
* [x] :white_check_mark: [`new_participant` email can use custom template](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151799)
* [ ] [Manage external participants on work items (External Participant UI)](https://gitlab.com/groups/gitlab-org/-/epics/11088 "Manage external participants on work items")
* [ ] :no_entry_sign: \~\~Depending on feedback, \~\~[~~implement single email for external participants~~](https://gitlab.com/gitlab-org/gitlab/-/issues/419388 "Service Desk: external Participants receive the same email as everyone else")
</td>
</tr>
</table>
### Permissions and Security
Proposal: Only the developer role and above can add additional participants. However, external participants can "add" participants by cc'ing email addresses.
### Documentation
### What does success look like, and how can we measure that?
We expect the usefulness of service desk to increase with the addition, and thereby overall usage of service desk to grow. We also believe this is important for small companies to service their customers, so we also expect use among premium customers to increase.
Proposal:
- percentage of tickets with more than one external participant
- percentage of premium usage
- Growth in active service desk projects (lagging indicator)
- Growth in number of tickets (lagging indicator)
### What is the type of buyer?
~~This feature extends existing `Service Desk` functionality which is a gitlab~2278657 feature.~~
Who is the decision-making buyer?
- GitLab Service Desk is a fit for small teams, which is closest to buying at the team level for enterprises. We will typically aim for ~"GitLab Premium" for this suite of features.
- Individuals using GitLab Service Desk can also benefit, but one on one conversations are more likely
<details>
<summary>MVC Solution</summary>
Note: The plan for this feature is to be available on all issues, but only visible to **project members**.
Add a quick action where users (who are project members) can specify one or multiple email participants to be added to an issue. [\[Design\]](https://gitlab.com/gitlab-org/gitlab/-/issues/195525/designs/Email_Participants\_-\_Quick_Action.png "Email_Participants_-_Quick_Action.png")
This would create a role for the email participant similar to the case where someone emails a service desk address and an issue is created (where they receive notifications on the issue and can reply with comments).When an email participant is added, we will:
1. Show an entry in the activity area informing project members of this. [\[Design\]](https://gitlab.com/gitlab-org/gitlab/-/issues/195525/designs/Email_Participants\_-\_Quick_Action\_-\_Completed.png "Email_Participants_-_Quick_Action_-_Completed.png")
2. Add an alert note under the comment box that explains email participants will be notified of this comment. [\[Design\]](https://gitlab.com/gitlab-org/gitlab/-/issues/195525/designs/Email_Participants\_-\_Quick_Action\_-\_Completed.png "Email_Participants_-_Quick_Action_-_Completed.png") (Note: In the future, when [private comments](https://gitlab.com/groups/gitlab-org/-/epics/2697 "Allow private comments on all commentable resources") are finished, users will be able to check that box so that a notification for that particular requirement is not sent to email participants. If that box is checked, we will need to at that point remove the alert note regarding email participants, as well as any future comments in that thread)
This should also include a quick action to **remove** email participants. [\[Design\]](https://gitlab.com/gitlab-org/gitlab/-/issues/195525/designs/Email_Participants\_-\_Quick_Action\_-\_Remove.png "Email_Participants_-_Quick_Action_-_Remove.png")
When an email participant is removed, we will:
1. Show an entry in the activity area informing project members of this.
2. Remove this email from the alert note, and if it is the only email participant, remove the alert note entirely.
I have also included designs for truncating the alert note, as well as the activity information in the case there are multiple participants added. [\[Design\]](https://gitlab.com/gitlab-org/gitlab/-/issues/195525/designs/Email_Participants\_-\_Quick_Action\_-\_Completed__multiple\_.png "Email_Participants_-_Quick_Action_-_Completed__multiple_.png")
I am assuming we will want to break some of this out for implementation, and perhaps not all of it will be necessary for MVC, which may include:
- Adding multiple email participants
- Showing an entry in the activity area for addition/removal
- Truncating email participants in alert note
- Truncating email participants in activity area
</details>
epic