       }
       withCurrentOncall msg, (old_username) ->
         data = { 'override': override }
-        pagerDutyPost msg, "/schedules/#{process.env.HUBOT_PAGERDUTY_SCHEDULE_ID}/overrides", data, (json) ->
+        pagerDutyPost msg, "/schedules/#{pagerDutyScheduleId}/overrides", data, (json) ->
           if json.override
             start = moment(json.override.start)
             end = moment(json.override.end)

pagerDutySubdomain   = process.env.HUBOT_PAGERDUTY_SUBDOMAIN
pagerDutyBaseUrl     = "https://#{pagerDutySubdomain}.pagerduty.com/api/v1"
pagerDutyApiKey      = process.env.HUBOT_PAGERDUTY_APIKEY

module.exports = (robot) ->
  robot.respond /pager( me)?$/i, (msg) ->

    until: oneHour,
    overflow: 'true'
  }
  pagerDutyGet msg, "/schedules/#{pagerDutyScheduleId}/entries", query, (json) ->
    if json.entries and json.entries.length > 0
      cb(json.entries[0].user.name)

