您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
util lib for TMS related scripts
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/486123/1321503/TMS_Library.js
- // ==UserScript==
- // @name TMS_Library
- // @namespace http://tampermonkey.net/
- // @version 1.0.1
- // @description util lib for TMS related scripts
- // @author bliushtein
- // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
- // @grant GM_xmlhttpRequest
- // ==/UserScript==
- class Constants {
- static DESIGN_GAP = "DesignGap";
- static CROSS_STREAM_GAP = "CrossStreamGap";
- static OVERHEAD_TYPES = ["DesignGap", "CrossStreamGap"];
- static DEV_STORY = "DevStory";
- static DESIGN_STORY = "DesignChapter";
- static BA_COMMUNICATION = "BACommunication";
- static CROSS_STREAM_COMMUNICATION = "CrossStreamCommunication";
- static DEV_TEST = "DevTest";
- }
- function delay(milliseconds){
- return new Promise(resolve => {
- setTimeout(resolve, milliseconds);
- });
- }
- function sendRequest(url, method = 'GET', body = null) {
- console.log(url, method, body);
- return new Promise((resolve, reject) => {
- GM_xmlhttpRequest({
- method: method,
- timeout: 5000,
- onerror: reject,
- ontimeout: reject,
- onload: resolve,
- headers: {
- Accept: 'application/json',
- 'Content-Type': 'application/json',
- // If a user agent is not passed - a POST request fails with 403 error
- 'User-Agent': 'Any',
- },
- data: body,
- url: url,
- });
- }).then(response => {
- if ([200, 201].indexOf(response.status) !== -1) {
- if (response.responseText == null) {
- return {};
- }
- return JSON.parse(response.responseText);
- }
- throw new Error(response.status + ' ' + response.statusText + ' ' + response.responseText);
- });
- }
- async function getIssues(keys, fields = ["timetracking", "components", "issuetype", "labels", "priority", "customfield_10200", "customfield_10201", "customfield_10006", "summary", "status", "issuelinks"]) {
- if (keys.length == 0) {
- return {issues: []};
- }
- return await sendRequest(`https://tms.netcracker.com/rest/api/latest/search?jql=issuekey IN (${keys.join(",")})&fields=${fields.join(",")}`);
- }
- async function getSubtasts(keys, fields = ["timetracking", "components", "issuetype", "labels", "status"]) {
- if (keys.length == 0) {
- return {issues: []};
- }
- return await sendRequest(`https://tms.netcracker.com/rest/api/latest/search?jql=parent IN (${keys.join(",")})&fields=${fields.join(",")}`);
- }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址