xSh0uTx / ChangeTask

// ==UserScript==
// @name         ChangeTask
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       xSh0uTx
// @match        https://qvcprod.service-now.com/change_task.do?*
// @icon         https://www.google.com/s2/favicons?domain=service-now.com
// @grant        none
// @license MIT
// @updateURL https://openuserjs.org/meta/xSh0uTx/ChangeTask.meta.js
// @downloadURL https://openuserjs.org/install/xSh0uTx/ChangeTask.user.js
// ==/UserScript==

function ME_button(event) {
  g_form.setValue('change_task.assigned_to', g_user.userID, g_user.fullName);
  if (event.shiftKey) {
    $('sysverb_update_and_stay').click();
  }
}

var assignedTo_addons = document.getElementById("viewr.change_task.assigned_to").parentElement;
assignedTo_addons.innerHTML = assignedTo_addons.innerHTML + '<button class="form_action_button header action_context btn btn-default" id="personal1" style="white-space: nowrap" type="button" title="" value="sysverb_update_and_stay" id="sysverb_update_and_stay" data-action-name="sysverb_update_and_stay"  name="not_important" data-original-title="Assign to yourself" aria-expanded="false">ME</button>';
document.querySelector("#personal1").addEventListener("click", ME_button, false);