Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1001 Bytes

File metadata and controls

56 lines (40 loc) · 1001 Bytes

Automatically sets each item at the close of the issue

Set the following items when the status is closed.
ステータスを終了にした時、下記の項目を設定します。

  • 100% done
    進捗率を100%に
  • If due date is not entered, set it to today
    期日が未入力なら今日を設定

Setting

Path Pattern

None

Insert Position

Bottom of issue form

Code

JavaScript

$(function () {

  $('#issue_status_id').on('change', function() {

    if ($('#issue_status_id').val() == '5') { // 5: Closed
      
      if ($('#issue_due_date').val() == '') {
        const today = $.datepicker.formatDate('yy-mm-dd', new Date());
        $('#issue_due_date').val(today);
      }

      $('#issue_done_ratio').val('100');
    }
  });
});

Result

result