OTS Logo
|
MCM Filler Tool

⚠️ Tampermonkey Setup Required

Install the AutoFill userscript once to enable auto-filling on MCM pages:

  1. Download: MCM_Filler.zip
  2. Open TampermonkeyDashboard+ (new script)
  3. Select all (Ctrl+A), delete, paste the script from the zip
  4. Press Ctrl+S to save
Show Tampermonkey script ▼
// ==UserScript==
// @name         MCM AutoFill Listener
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Listens for fill commands from the MCM Filler page
// @match        https://mcm.amazon.com/cms/new*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';
    var filled = false;
    window.addEventListener('message', function(e) {
        if (!e.data || e.data.type !== 'FAT1_MCM_FILL' || filled) return;
        var vars = e.data.vars;
        var schedule = e.data.schedule;
        var scheduleEnd = e.data.scheduleEnd;
        function tryFill() {
            var count = 0, total = Object.keys(vars).length;
            Object.entries(vars).forEach(function(pair) {
                var name = pair[0], value = pair[1];
                var el = document.querySelector('textarea[name="templateVariables[{{' + name + '}}]"]');
                if (el) {
                    el.value = value;
                    el.dispatchEvent(new Event('input', {bubbles: true}));
                    el.dispatchEvent(new Event('change', {bubbles: true}));
                    count++;
                }
            });
            if (count === 0 && total > 0) { setTimeout(tryFill, 2000); return; }
            filled = true;
            if (schedule) {
                var startEl = document.querySelector('input[name="scheduled_start"]');
                if (startEl) {
                    startEl.value = schedule;
                    startEl.dispatchEvent(new Event('input', {bubbles: true}));
                    startEl.dispatchEvent(new Event('change', {bubbles: true}));
                    startEl.dispatchEvent(new Event('blur', {bubbles: true}));
                }
                var autoCalc = document.querySelector('input[name="auto_calc_scheduled_end"]');
                if (autoCalc && autoCalc.checked) { autoCalc.click(); }
                if (scheduleEnd) {
                    var endEl = document.querySelector('input[name="scheduled_end"]');
                    if (endEl) {
                        endEl.value = scheduleEnd;
                        endEl.dispatchEvent(new Event('input', {bubbles: true}));
                        endEl.dispatchEvent(new Event('change', {bubbles: true}));
                        endEl.dispatchEvent(new Event('blur', {bubbles: true}));
                    }
                }
            }
            document.title = '✅ ' + (vars.switch_hostname || 'MCM') + ' (' + count + '/' + total + ')';
        }
        setTimeout(tryFill, 2000);
    });
})();

Template

Common Variables

Your login (person creating the MCM)
Login of the person performing the change
Login of the stakeholder approving the change
Login of the IT manager for approval
L1 team CTI for routing
Target VLAN number for the port change
Site code in lowercase
Site code in uppercase
Link to the ServiceNow project task or ticket
Brief reason shown in MCM title
Detailed description of the change

Switches

Format: switch-hostname | port1, port2, port3 — one switch per line. Only used for Port Change templates, not IDF Cleaning.

Schedule

Times are auto-generated on the next page. You can pick a specific date/time for each MCM (must be 72+ hours from now).

Create MCMs

Click "Create & Fill" for each switch. The MCM page opens and fields auto-fill via the Tampermonkey listener.

#SwitchPortsScheduled DateTimeAction