diff --git a/servicenow-inc-autostart-timer.js b/servicenow-inc-autostart-timer.js new file mode 100644 index 0000000..c6ee4ea --- /dev/null +++ b/servicenow-inc-autostart-timer.js @@ -0,0 +1,23 @@ +// ==UserScript== +// @name ServiceNow - Automatically start the incident timer +// @namespace it.epfl.ch +// @description Start the time counter automatically when an incident is loaded +// @include https://it.epfl.ch/backoffice/* +// @include https://it-test.epfl.ch/backoffice/* +// @version 0.2 +// @grant none +// ==/UserScript== + +// Log +// * Apparently there are various different start buttons, I'm now using the +// image to find the button +// -- 2015-09-11 Florian Vessaz +// * Initial version +// -- 2015-09-11 Florian Vessaz + +setTimeout(function(){ + var button = document.getElementById("link.incident.time_worked").parentElement; + if (button != null) { + button.click(); + } +}, 1000);