Skip to main content

Event-based recipes

These recipes handle data that is collected when some event is raised. Each event can be enabled per application in the Events column of the integration's application mapping; the recipe runs for whichever events you enabled there.

EventShown in the dashboard asCarries an issue?
issue.createdNew issue reportedYes
issue.updatedIssue updatedYes
issue.closedIssue closedYes
issue.reopenedIssue reopenedYes
issue.regressedIssue regressedYes
issue.deletedIssue deletedYes
issue.commentNew comment in issueYes
recording.createdRecording was added to an issueNo
recording.deletedRecording was deleted from an issueNo
unsymbolicated.createdNew issue without symbolsYes
feedback.message.inNew message from device in feedbackNo
feedback.message.outNew message from dashboard in feedbackNo

Not every event carries an issue, so inspect event.type before reaching into event.payload:

if (event.type === 'issue.created') {
const issue = event.payload.issue; // present
} else if (event.type === 'recording.created') {
// no payload.issue here — the event is about the recording
}

The data structures passed to the handle() method follow the ones used in Webhooks, so for details on what is available for each event refer to the Webhook events. The match is close but not exact: the payload a recipe receives is rendered for messaging, so severity arrives as a name rather than the numeric level used in webhooks, and fields such as reporter, attributes and statistics are not included.

info

Notification Relay messages sent with Bugsee.notify are delivered through a separate opt-in — the Relay checkbox on the application mapping, together with the application's Notification Relay settings — and not through the Events list above. They still reach the same handle() method, with the notification presented in the shape of an issue so that existing recipes keep working.

function handle(event) {
const result = {};

// To get familiar with recipes, please, refer to the docs
// https://docs.bugsee.com/integrations/

const eventType = event.type;
const payload = event.payload;

if (eventType === 'issue.created') {
const issue = payload.issue;

result.title = `${issue.key || '<#>'}: ${issue.summary || 'No summary'} [Bugsee]`;
}

result.fields = [
// Add custom fields here that will be displayed with the message.
// Each field is represented as { title: '', value: '' }
];

return result;
}

Note that the result is not used as-is. Before executing the recipe, a default message object is constructed. Then, when recipe result is received, it extends that default object (replaces the default values on corresponding fields).

result object is constructed from the following fields:

  • title
  • description
  • severity
  • fields
FieldTypeDescription
titleStringTitle of the message
descriptionStringDescription for the message
severityNumberMessage severity. Value from 1 through 5 (from lower to higher). Pass 0 to ignore severity.
fieldsArrayArray of { title: '', value: '' } objects, that denote the additional fields for the message.

If you want to prevent pushing message to remote service, return null from the handle().

Found an issue, typo, or wrong statement on this page? Report it now →