   e.room = room if room?
   robot.send e, m
 
-onIssueCreated = (robot, space, w) ->
-  projectKey = w.project.projectKey
-  project = space.getProject projectKey
-  unless project?
-    robot.logger.warning 'hubot-fgb: unknown project key: ' + projectKey
-    return
+onIssueCreated = (robot, space, project, w) ->
   issueKey = "#{project.getKey()}-#{w.content.key_id}"
   issueUrl = "https://#{space.getId()}.backlog.jp/view/#{issueKey}"
   summary = w.content.summary


  robot.router.post '/hubot/fgb/backlog/webhook', (req, res) ->
    webhook = req.body
    if webhook.type is 1 # issue created
      onIssueCreated robot, space, webhook
    else if webhook.type is 2 # issue updated
      onIssueUpdated robot, space, webhook, requests
    else if webhook.type is 3 # issue commented
      onIssueCommented robot, space, webhook
    else
      return if webhook.type <= 17 # max webhook.type
      robot.logger.warning "hubot-fgb: unknown webhook type: #{webhook.type}"

  """
  sendToChat robot, { room, message }

onIssueUpdated = (robot, space, project, w, requests) ->
  issueKey = "#{project.getKey()}-#{w.content.key_id}"
  issueUrl = "https://#{space.getId()}.backlog.jp/view/#{issueKey}"
  summary = w.content.summary
