Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cases] Notify users when assigned on a case #142307

Closed
cnasikas opened this issue Sep 30, 2022 · 4 comments · Fixed by #144391
Closed

[Cases] Notify users when assigned on a case #142307

cnasikas opened this issue Sep 30, 2022 · 4 comments · Fixed by #144391
Labels
Feature:Cases Cases feature Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@cnasikas
Copy link
Member

cnasikas commented Sep 30, 2022

In 8.5, we introduced the ability to assign users to a case. We want to notify users when they assigned to a case. By using the notification service, described here #140743, Cases will send an email with the following details:

  • The title of the Case that triggered the notification in the email’s subject
  • The severity of the case in the email body
  • A backlink to the Kibana Case in the email body
@cnasikas cnasikas added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature labels Sep 30, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@EricDavisX
Copy link
Contributor

Christos is discussing:

  • 2 main work flows: Creating a case, and updating a case.
  • when removing a user, no email will be sent (for this mvp at least)
  • if a user doesn't want this functionality, they can (or simply won't setup) the kibana yml side
  • if you (user) assign's yourself, you won't get an email
  • if you update a case, only the new assignees added will get the email (not repeat emails for same case)

@cnasikas does that list and spec look correct? Please do edit this comment and add more AC/Specs if you wish!

@cnasikas
Copy link
Member Author

cnasikas commented Nov 2, 2022

@EricDavisX LGTM!

cnasikas added a commit that referenced this issue Nov 8, 2022
## Summary

The PR adds the ability to notify users by email when assigned to a
case. A user is:
- Not notified if he/she assigns themselves
- Notified if added as an assignee to a case
- Not notified if removed from a case

I did not add integration tests due to the complexity of simulating an
email server. I added unit test coverage. If integration test coverage
is needed we can add the tests on another PR.

Depends on: #143303
Fixes: #142307

## Email screenshot

<img width="361" alt="Screenshot 2022-11-07 at 1 27 13 PM"
src="https://user-images.githubusercontent.com/7871006/200299356-52c08515-4d43-49d6-bd47-3797b52f97e5.png">

@shanisagiv1 @lcawl What do you think about the content of the email
(see screenshot)?

## Testing

1. Put the following in your `kibana.yml`:

```
notifications.connectors.default.email: 'mail-dev'

xpack.actions.preconfigured:
  mail-dev:
    name: preconfigured-email-notification-maildev
    actionTypeId: .email
    config:
      service: other
      from: mlr-test-sink@elastic.co
      host: localhost
      port: 1025
      secure: false
      hasAuth: false
```

2. Install [`maildev`](https://www.npmjs.com/package/maildev): `npm
install -g maildev`
3. Run `maildev`: `maildev`
4. Open MailDev's web interface (http://0.0.0.0:1080/)
5. Create a case and assign users. You should see the emails in the
MailDev inbox.
6. Update the assignees of a case. You should see the emails in the
MailDev inbox.

Note: If you assign yourself you should not see an email. If you delete
an assignee you should not see an email.

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release notes

Notify users by email when assigned to a case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Cases Cases feature Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants