• Get started
  • Documentation

Integrate Opsgenie with Mattermost

Mattermost logo

What does Opsgenie offer for Mattermost users?

Opsgenie has a two-way integration with Mattermost. It's powerful and easy to configure: notifications of Opsgenie’s robust alerts go right into a Mattermost channel. In turn, users acknowledge, close or assign these alerts from the channel, as easily as entering a command like /genie ack 12.

Add a Mattermost integration in Opsgenie, and in seconds combine Mattermost's easy-to-use team collaboration platform with Opsgenie’s rich alert notification system and on-call rotation. Execute actions on the alert just by typing a /genie command into the chat.

Accomplish more in Opsgenie by entering simple commands to Mattermost channel. Using /genie commands, mute Opsgenie notifications, get alert details, view on-call schedules, etc.

"Require Matching a User" option is used to force matching Mattermost accounts with Opsgenie accounts. Chat user mapping section addresses this issue.

Configuring Mattermost Integration

  1. In Mattermost, enable incoming webhooks and slash commands from Main Menu > System Console > Integrations > Custom Integrations.

  2. To create Mattermost Incoming Webhook, go to Main Menu > Integrations > Incoming Webhooks and click Add Incoming Webhook.

  3. Fill in "Display Name" and "Description" fields, and select the channel or private group to receive webhook payloads, then click Save to create the webhook.

Mattermost webhook

4. After adding incoming webhook, a page appears. Copy the URL given on that page.

Mattermost webhook

5. Go to your Opsgenie account.

6. From Settings > Integrations, search for Mattermost and select Add

7. Paste the URL copied from Mattermost to the "Mattermost URL" field.

8. Copy the Request URL in order to use it while adding slash commands in Mattermost.

9. Click Save Integration.

Mattermost integration

10. Go to Mattermost and from Main Menu > Integrations > Slash Commands, then select Add Slash Command.

11. Enter genie into the "Command Trigger Word" field.

12. Paste the URL copied from Opsgenie to the "Request URL" field.

Mattermost slash commands

13. Click Update.

If you're using Opsgenie's Free or Essentials plan or if you’re using Opsgenie with Jira Service Management's Standard plan, you can add this integration from your team dashboard only. The Integrations page under Settings is not available in your plan.

  1. Go to Teams and select your team.

  2. Select Integrations on the left navigation and then select Add integration.

Adding the integration from your team dashboard will make your team the owner of the integration. This means Opsgenie will assign the alerts received through this integration to your team only. Follow the rest of the steps in this section to set up the integration.

Chat User Mapping

  1. "Require Matching a User" is used to force matching Mattermost accounts with Opsgenie accounts.

  2. Associate a Mattermost account to a Opsgenie account by using the /genie connect command.

  3. For more information, refer to Chat User Mapping.

  4. Chat user mapping flow:

  • First, write /genie connect command. Click the "authenticate in opsgenie" link.

Mattermost connect command
  • In the opened tab, the link directs to the Opsgenie login page. Login and click Approve.

Mattermost approve account
  • Now, the Opsgenie account is connected to the Mattermost team.

Mattermost account connect

Using /genie Command

Easily execute actions on Opsgenie alerts by entering a command with the tinyId of the alert into a Mattermost room. Note that single command can be executed on multiple alerts.

Use the alert command to create an alert in Opsgenie, right from a Mattermost channel.

Acknowledge Alert:

/genie ack [tinyID tinyID2..]

 

Examples:

/genie ack 1


/genie ack 1 2 3

 

Close Alert:

/genie close [tinyID tinyID2..]

 

Examples:

/genie close 1


/genie close 1 2 3

 

Add Note to Alert:

/genie note [note] to [tinyID tinyID2..]

 

Examples:

/genie note this is note to 1


/genie note this is note to 1 2 3

 

Add Tag to Alert:

/genie addtag [tag1,tag2,..] to [tinyID tinyID2..]

 

Examples:

/genie addtag high priority,important to 1


genie addtag high priority,important to 1 2 3

 

Acknowledge All Open Alerts:

/genie ackall

 

Close All Open Alerts:

/genie closeall

 

Assign Alert:

/genie assign [tinyID tinyID2..] to [user]

 

Examples:

/genie assign 1 to john.smith@acme.com


/genie assign 1 2 3 to john.smith@acme.com

 

Take Ownership of Alert:

/genie own [tinyID tinyID2..]

 

Examples:

/genie own 1


/genie own 1 2 3

 

Update Priority of Alert:

/genie update priority to [P1, P2, P3, P4 or P5] for [tinyID]

 

Examples:

/genie update priority to P2 for 1341

 

Execute Action:

/genie exec [action] on [tinyID tinyID2..]

 

Examples:

/genie exec customAction on 1


/genie exec customAction on 1 2 3

 

Create Alert:

/genie alert [alert message] for [team1,team2,user1..]

 

Examples:

/genie alert this is alert message for john.smith@acme.com


/genie alert this is alert message for myTeam
/genie alert this is alert message for myTeam,john.smith@acme.com

 

Get Alert:

/genie get [tinyID]

 

Example:

/genie get 1

 

List Alerts:
Lists all open alerts.

/genie list

 

Lists all open alerts of specified team.

/genie list alerts of team1

 

List Integrations:

/genie list integrations

 

List Policies:

/genie list policies

 

List Teams :

/genie list teams


/genie list teams contains [search query]
/genie list teams starts with [search query]

 

Enable Integration/Policy:

/genie enable [name]

 

Example:

/genie enable policy

 

Disable Integration/Policy:

/genie disable [name]

 

Example:

/genie disable policy

 

Take On-call:
Takes on-call for the specified amount of time for the team or schedule. Default amount of time is 1h. If no schedule/team is specified, the user takes on-call for their team's schedule, or a single schedule they participate in.

/genie oncall [me/user] [h/m/d] for [team/schedule/all]

 

Sample uses are:

/genie oncall me 2h for weekend_schedule


/genie oncall john.smith@acme.com 1d for ops_team
/genie oncall me 2h for all
/genie oncall me 45m
/genie oncall me

 

Who is oncall:
Retrieves oncall user information from all schedules

/genie whoisoncall

 

Mute:
Mutes notifications for the user. Mutes for 5 minutes if not given.

/genie mute [me/username] [minutes(optional)]

 

Example:

/genie mute john.smith@acme.com


/genie mute john.smith@acme.com 15

 

Unmute:
Clears mute setting.

/genie unmute [me/username]

 

Example:

/genie unmute john.smith@acme.com

 

Connect:
Connect an Opsgenie account to a chat account. If a connection exists, the currently connected Opsgenie user is shown and a disconnect option is shown.

For more details see the Chat User Mapping documentation page.

 

/genie connect

 

Help:

/genie help

 

Still need help?

The Atlassian Community is here for you.