 
 module.exports = (robot) ->
   cache = []
-  jiraDomain = process.env.HUBOT_JIRA_DOMAIN
-  jiraProtocol = process.env.HUBOT_JIRA_PROTOCOL || "https"
-  jiraPort = process.env.HUBOT_JIRA_PORT || 80
-  jiraUrl = "#{jiraProtocol}://#{jiraDomain}:#{jiraPort}"
-
-  if jiraProtocol == 'https'
-    http = require 'https'
-  else
-    http = require 'http'
-
+  jiraUrl = process.env.HUBOT_JIRA_URL
   jiraUsername = process.env.HUBOT_JIRA_USERNAME
   jiraPassword = process.env.HUBOT_JIRA_PASSWORD
+  
   if jiraUsername != undefined && jiraUsername.length > 0
     auth = "#{jiraUsername}:#{jiraPassword}"
 

            cache.shift() until cache.length is 0 or cache[0].expires >= now
          if cache.length == 0 or (item for item in cache when item.issue is issue).length == 0
            cache.push({issue: issue, expires: now + 120000})
            msg.http(jiraUrl + "/rest/api/2/issue/" + issue)
              .auth(auth)
              .get() (err, res, body) ->
                try

  if jiraIgnoreUsers == undefined
    jiraIgnoreUsers = "jira|github"

  robot.http(jiraUrl + "/rest/api/2/project")
    .auth(auth)
    .get() (err, res, body) ->
      json = JSON.parse(body)
      jiraPrefixes = ( entry.key for entry in json )
      reducedPrefixes = jiraPrefixes.reduce (x,y) -> x + "-|" + y
      jiraPattern = "/\\b(" + reducedPrefixes + "-)(\\d+)\\b/g"
