File: teams.md

package info (click to toggle)
ruby-exception-notification 5.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 364 kB
  • sloc: ruby: 1,350; makefile: 2
file content (54 lines) | stat: -rw-r--r-- 1,887 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
### Teams notifier

Post notification in a Microsoft Teams channel via [Incoming Webhook Connector](https://docs.microsoft.com/en-us/outlook/actionable-messages/actionable-messages-via-connectors)
Just add the [HTTParty](https://github.com/jnunemaker/httparty) gem to your `Gemfile`:

```ruby
gem 'httparty'
```

To configure it, you **need** to set the `webhook_url` option.
If you are using GitLab for issue tracking, you can specify `git_url` as follows to add a *Create issue* button in your notification.
By default this will use your Rails application name to match the git repository. If yours differs, you can specify `app_name`.
By that same notion, you may also set a `jira_url` to get a button that will send you to the New Issue screen in Jira.

```ruby
Rails.application.config.middleware.use ExceptionNotification::Rack,
  email: {
    email_prefix: "[PREFIX] ",
    sender_address: %{"notifier" <notifier@example.com>},
    exception_recipients: %w{exceptions@example.com}
  },
  teams: {
    webhook_url: 'https://outlook.office.com/webhook/your-guid/IncomingWebhook/team-guid',
    git_url: 'https://your-gitlab.com/Group/Project',
    jira_url: 'https://your-jira.com'
  }
```

#### Options

##### webhook_url

*String, required*

The Incoming WebHook URL on Teams.

##### git_url

*String, optional*

Url of your gitlab or github with your organisation name for issue creation link (Eg: `github.com/aschen`). Defaults to nil and doesn't add link to the notification.

##### jira_url

*String, optional*

Url of your Jira instance, adds button for Create Issue screen. Defaults to nil and doesn't add a button to the card.

##### app_name

*String, optional*

Your application name used for git issue creation link. Defaults to `Rails.application.class.module_parent_name.underscore` for Rails versions >= 6;
`Rails.application.class.parent_name.underscore` otherwise.