ServiceNow - Show Workflow Contexts

Add Related Link to go to Workflow Context for current record

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         ServiceNow - Show Workflow Contexts
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Add Related Link to go to Workflow Context for current record
// @author       Ricardo Constantino <[email protected]>
// @match        https://*.service-now.com/*.do?*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    if (typeof g_form === 'undefined') return;

    var relatedLinksContainer = document.querySelector('ul.related_links_container');
    if (!relatedLinksContainer || relatedLinksContainer.children.length < 1) return;

    //var versionsElement = relatedLinksContainer.children[0].cloneNode(true);
    let versionsElement = document.createElement('li');
    let linkElement = document.createElement('a');
    linkElement.href = '/wf_context.do?sysparm_query=id=' + g_form.getUniqueValue();
    linkElement.textContent = 'Show Workflow Contexts';
    linkElement.addClassName('navigation_link');
    versionsElement.appendChild(linkElement);
    relatedLinksContainer.insertAdjacentElement('afterbegin', versionsElement);
})();