     update: (attributes, callback) =>
       @put "/issues/#{id}.json", {issue: attributes}, callback
 
-  TimeEntry: (id) ->
+    add: (attributes, callback) =>
+      @post "/issues.json", {issue: attributes}, callback
+
+  TimeEntry: (id = null) ->
 
     create: (attributes, callback) =>
       @post "/time_entries.json", {time_entry: attributes}, callback

    attributes =
      "notes": "#{msg.message.user.name}: #{note}"

    redmine.Issue(id).update attributes, (err, data) ->
      if err?
        if err == 404
          msg.reply "Issue ##{id} doesn't exist."
        else
          msg.reply "Couldn't update this issue, sorry :("
      else
        msg.reply "Done! Updated ##{id} with \"#{note}\""

  # Robot assign <issue> to <user> ["note to add with the assignment]
  robot.respond /assign (?:issue )?(?:#)?(\d+) to (\w+)(?: "?([^"]+)"?)?/i, (msg) ->

#                                                     *With optional notes
# update <issue-id> with "<note>"  - Adds a note to the issue
# add <hours> hours to <issue-id> ["comments"]  - Adds hours to the issue with the optional comments
# link me <issue-id> - Returns a link to the redmine issue
# set <issue-id> to <int>% ["comments"] - Updates an issue and sets the percent done
#
#
# Note: <issue-id> can be formatted in the following ways:
#       1234, #1234, issue 1234, issue #1234
