Skip to content

Instantly share code, notes, and snippets.

@eurica
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eurica/f8c9089e167b79ecc381 to your computer and use it in GitHub Desktop.
Save eurica/f8c9089e167b79ecc381 to your computer and use it in GitHub Desktop.
Manually Trigger an incident in PagerDuty
/* This is the button I'm using to trigger the incident:
<input type="button" onclick="PDTrigger(prompt('Incident Description'))" value="Trigger Incident">
*/
// Set up the library
PDJS = new PDJSobj()
function PDTrigger(description) {
// Trigger via the rest API
PDJS.trigger({
service_key: "660ca1d238914a2e8cb26248687cba20",
description: description,
incident_key: "manual_incident_"+Math.random(),
details: {
language: "English",
page: "http://euri.ca"
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment