 
     openIssues msg, msg.match[2], (text) ->
       msg.reply text
+
+  robot.respond /jira comment (\w+-[0-9]+) (.*)/i, (msg) ->
+    if msg.message.user.id is robot.name
+      return
+
+    comment msg, msg.match[1], msg.match[2], (text) ->
+      msg.reply text
   
   robot.respond /([^\w\-]|^)(\w+-[0-9]+)(?=[^\w]|$)/ig, (msg) ->
     if msg.message.user.id is robot.name


  recentissues = new RecentIssues issuedelay

  get = (msg, where, cb) ->
    console.log(process.env.HUBOT_JIRA_URL + "/rest/api/latest/" + where)

    httprequest = msg.http(process.env.HUBOT_JIRA_URL + "/rest/api/latest/" + where)
    if (process.env.HUBOT_JIRA_USER)
      authdata = new Buffer(process.env.HUBOT_JIRA_USER+':'+process.env.HUBOT_JIRA_PASSWORD).toString('base64')
      httprequest = httprequest.header('Authorization', 'Basic ' + authdata)
    httprequest.get() (err, res, body) ->
        cb JSON.parse(body)

  watchers = (msg, issue, cb) ->
    get msg, "issue/#{issue}/watchers", (watchers) ->

        return 

      cb comments.comments.map((comment) -> return comment.body)

  comment = (msg, issue, text, cb) ->
    post msg, "issue/#{issue}/comment", { body: "comment from #{msg.message.user.name} (via Hubot):\n\n" + text }, (comment) ->
      console.log comment
      cb "Ok, commented on #{issue}: #{text}"

  info = (msg, issue, cb) ->
    get msg, "issue/#{issue}", (issues) ->
