最近の検索


最近の検索はありません

Add enable/disable "Alert On-Call engineer" option in end user ticket form as per need.



投稿日時:2023年2月07日

Currently we don't have any option to disable the "Alert On-Call engineer" checkbox in end user's form. For example a form to open a ticket for my org looks like this.

We want at least this: 

1. If user is not authenticated and opening a ticket via form disable the option for them.

 

 

 


1

3

3件のコメント

Thank you so much Dan R.

Ashok Gangwar, use the below code to disable the ticket in dropdown field if user is not authenticated:

For your special form.

$(document).ready(function(){
  if (HelpCenter.user.role=="anonymous"){
var tagsToRemove = ['TICKET ID'];  //special form ID

function removeTagsWeDontWant() {
$('.nesty-panel').on('DOMNodeInserted', function(e){
for(var i in tagsToRemove) {
$('li#' + tagsToRemove[i]).remove();
}
});
};
removeTagsWeDontWant();
  }
})

 

TICKET ID: remove this string and add your ticket ID like 5361002484244, for which you want to hide form from un-auhenticated users.

Add the given CDN to your document_head.hbs file.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>

 

And if, you only want to disable dropdown field for un-authenticated users then add this code instead previous code:

$(document).ready(function(){
    if (HelpCenter.user.role=="anonymous"){
       $("div.form-field.select.optional.request_ticket_form_id a.nesty-input ").css('pointer-events','none');
  }
})

But add jQuery CDN to your document_head.hbs file which I shared above.

 

If any query feel free to ask :)

Thanks

0


Hey Ashok,

You could likely do this by adding a custom field to the ticket form and if it's checked off by the requester, have a trigger send an alert to whatever on-call platform you're using. 

It's also possible to customize your submit request form to test if a user is signed in, and if not, hide this field, though it would require a small amount of development work to do so.

Ifra Saqlain, one of my great colleagues in the moderator community, posted a great example of the code needed to see if a user is signed in that might help get you started.

0


Somehow the portal is not accepting image. Not sure how to send you the image.

 

0


サインインしてコメントを残します。

お探しのものが見つかりませんか?

新規投稿