jiracalc

atlassian jira storypoint calculator

目前為 2018-01-19 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        jiracalc
// @name:ru     jiracalc
// @namespace   jc
// @description atlassian jira storypoint calculator
// @description:ru калькулятор сторипоинтов для atlassian jira
// @include     https://digipro.atlassian.net/issues/*
// @version     1.1
// @grant       none
// @copyright   [email protected]
// ==/UserScript==
function jiracalc()
{
  if ($('.customfield_10005').size() > 0)
  {
    var sum = [];
    
    $('.customfield_10005').each(function (i, elm)
    {
      var el = $(elm);
      if (el.text() !== '') 
      {
        var com = el.parent().find('.components').text();
        if (com) com = com.trim();
        if (com != '')
        {
          if (isNaN(sum[com])) sum[com] = 0;
          sum[com] += parseFloat(el.text());
        }
      }
    });
    var msg = '';
    for (var prop in sum)
    {
      msg += '<b>' + prop + ':</b> ' + sum[prop] + ' ';
    }
    if (!$('.jiracalc').size()) $('.aui-item:eq(0)').append('<div class=\'jiracalc\' style=\'font-size: 16px; width: 100%; text-align: center; margin: 10px\'>calllllc</div>');
    $('.jiracalc').html(msg);
  }
}
setInterval(jiracalc, 2000);