カスタムフィールドの値を題名の先頭につける
参考サイト↓
/issues/(new|[0-9]+/copy)
//チケット作成時(またはコピー時にカスタムフィールドの値を題名と連結させる
//チケット作成後の編集はカスタム値を変更したとき題名訂正できないので注意
$(function() {
const changeVisibility = function() {
// 題名の先頭にカスタムフィールドの値を埋め込む
var subject = $('#issue_custom_field_values_5 option:selected').text() + ':' + $('#issue_subject').val();
$('#issue_subject').val(subject);
}
// 値が変わったタイミングで切り替え
$('#all_attributes').on('change', '#issue_custom_field_values_5', function(e) {
changeVisibility ();
});
// ステータス変更時などにDOMが差し替えられるので
// フォームの内容が書き変わるたびに表示切替
var _replaceIssueFormWith = replaceIssueFormWith;
replaceIssueFormWith = function(html){
_replaceIssueFormWith(html);
changeVisibility ();
};
});