bugsnag-notification-plugins
Version:
Notification plugins (chat and issue tracking integrations) for Bugsnag.
28 lines (22 loc) • 723 B
text/coffeescript
NotificationPlugin = require "../../notification-plugin"
class Bugify extends NotificationPlugin
@receiveEvent: (config, event, callback) ->
return if event?.trigger?.type == "reopened"
payload =
subject: @title(event)
description: @markdownBody(event)
project: config.projectId
@request
.post("#{config.url}/api/issues.json")
.timeout(4000)
.auth(config.apiKey, "")
.type("form")
.send(payload)
.on "error", (err) ->
callback(err)
.end (res) ->
return callback(res.error) if res.error
callback null,
id: res.body.issue_id
url: "#{config.url}/issues/#{res.body.issue_id}"
module.exports = Bugify