     if config.customFields
       Object.merge(payload.fields, JSON.parse(config.customFields))
 
+    # https://example.com/jira becomes https://example.com/jira/
+    config.host += "/" unless /\/$/.test(config.host)
+
     # Send the request
     @request
-      .post(url.resolve(config.host, "/rest/api/2/issue"))
+      .post(url.resolve(config.host, "rest/api/2/issue"))
       .timeout(4000)
       .auth(config.username, config.password)
       .set('Accept', 'application/json')

        callback null,
          id: res.body.id
          key: res.body.key
          url: url.resolve(config.host, "/browse/#{res.body.key}")
        
module.exports = Jira
class Jira extends NotificationPlugin
  stacktraceLines = (stacktrace) ->
    ("#{line.file}:#{line.lineNumber} - #{line.method}" for line in stacktrace when line.inProject)

  jiraBody = (event) ->
    """
    h1. #{event.trigger.message} in #{event.project.name}
