       "priority": config.priority
 
     # Send the request
-    @request
-      .post(url.resolve(BASE_URL, "/api/1.0/repositories/#{config.username}/#{config.repo}/issues"))
-      .timeout(4000)
-      .auth(config.username, config.password)
-      .set('Accept', 'application/json')
+    @bitbucketRequest(@request.post(@issuesUrl(config)), config)
       .send(qs.stringify(query_object))
       .on "error", (err) ->
         callback(err)


class BitbucketIssue extends NotificationPlugin
  BASE_URL = "https://bitbucket.org"

  @openIssue: (config, event, callback) ->
    query_object =


        callback null,
          id: res.body.local_id
          url: url.resolve(BASE_URL, "#{config.username}/#{config.repo}/issue/#{res.body.local_id}")

  @receiveEvent: (config, event, callback) ->
    if event?.trigger?.type == "reopened"
