LoginSignup
1
0

More than 3 years have passed since last update.

JIRAの数値フィールドにて画面表示の度にカウントアップする方法

Last updated at Posted at 2019-06-06

画面表示の度に数値フィールドのカウントをアップする

①カウントアップ対象の数値フィールド(カスタムフィールド)のIDをメモする
 (フィールド構成画面を開いた時にURLにIDが表示されている)

②フィールドの編集画面の説明欄に下記のスクリプトを記載する
(customfield_nnnnnの「nnnnn」はカスタムフィールドID)
 (編集画面でカウント用フィールドは非表示にする記述になっています)


<script>
  AJS.toInit(function(){
     var countField = document.getElementById('customfield_nnnnn');
     if (countField){countField.parentElement.style.display='none';
     var val = countField.value;
     if (val){
         countField.value = Number(val) +1;
         } else {
         countField.value = 1;
         }
     }
});
</script>

③上記フィールドを画面定義する。

JIRA Softwareバージョンは7.12.1

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0