bugsnag-notification-plugins
Version:
Notification plugins (chat and issue tracking integrations) for Bugsnag.
31 lines (24 loc) • 805 B
text/coffeescript
NotificationPlugin = require "../../notification-plugin"
class Bugify extends NotificationPlugin
: (config, event, callback) ->
if event?.trigger?.type == "linkExistingIssue"
return callback(null, null)
return if event?.trigger?.type == "reopened"
payload =
subject:
description:
project: config.projectId
.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