 url = require "url"
 qs = require 'qs'
 
-class BitbucketIssue extends NotificationPlugin     
+class BitbucketIssue extends NotificationPlugin
+  BASE_URL = "https://bitbucket.org"
   @receiveEvent: (config, event, callback) ->
 
     query_object =


    # Send the request
    @request
      .post(url.resolve(config.url, "/api/1.0/repositories/#{config.repo}/issues"))
      .timeout(4000)
      .auth(config.username, config.password)
      .set('Accept', 'application/json')


        callback null,
          id: res.body.local_id
          url: url.resolve(BASE_URL, "#{res.body.resource_uri}")

module.exports = BitbucketIssue