最近の検索
最近の検索はありません

Raul Daniel Trejo
参加日2022年8月31日
·
前回のアクティビティ2022年8月31日
フォロー中
0
フォロワー
0
合計アクティビティ
2
投票
0
サブスクリプション
1
アクティビティの概要
バッジ
記事
投稿
コミュニティへのコメント
記事へのコメント
アクティビティの概要
さんの最近のアクティビティ Raul Daniel Trejo
Raul Daniel Trejoさんがコメントを作成しました:
Hey everyone! My team has a custom solution to this problem. We have custom fields in our ticket submission form, and we also have some values that we don't want to display to our users.
In the following code block the value in pointer1=$('.request_custom_fields_+field_id) is the class assigned to the dropdown div. Replace "field_id" with the id of the dropdown you wish to hide values in.
Replace the the "tag" values in the private_options array, for the values that you wish to hide in the dropdown, you can find these by going to the field in Zendesk Admin page. (It must be the tags and not labels).
It's not a beautiful solution, but I hope it helps someone out there!
/*---------------------Function to restrict contact reason fields------------------------------*/
var pointer1=$('.request_custom_fields_'+field_id).children('a').attr('aria-controls');
var skip1='#'+pointer1
$(skip1).on('DOMNodeInserted', function(e){
var nesty=$(this);
//get all cr values
var raw_cr_options=nesty.children('ul').children();
var all_cr_options=raw_cr_options.map(function(cr){
var li=raw_cr_options[cr];
var id=li.getAttribute('id');
return id;
});
var private_options= ['outage_notification', 'infrastructure_notification']
//filter for only the desired values
var remove_cr=all_cr_options.filter(function(cr){
var li=all_cr_options[cr];
return (private_options.includes(li));
});
remove_cr=remove_cr.map(function(cr){
var li=remove_cr[cr];
return ('#'+li);
});
remove_cr=Array.from(remove_cr);
try {
var i;
for (i=0; i
raw_cr_options.remove(remove_cr[i]);
}
} catch (error) {
console.log (i);
console.log('ERROR!', error);
}
});
コメントを表示 · 投稿日時:2022年8月31日 · Raul Daniel Trejo
0
フォロワー
2
投票
0
コメント