- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 08:44 PM
Hi,
When monitoring team & delivery team members are creating security incident then source should be "phone" by default. it should restrict others to create a source is phone.
EX:
I'm member of monitoring team and I'm creating security incident after click on new button then source should be phone for me and for others it should be none.
Regards,
Sanju
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 10:37 PM
it's showing error, even the part of that particular group and after that I added myself as user from that particular group. then it's working fine but for the existed users it's not working. I'm I created function in right way? why it's showing error like this.
EXISTING USERS:
FOR ME:
CLIENT SCRIPT:
function onLoad() {
var sysid = g_user.userID; //get current user sysid
var ga = new GlideAjax('sn_si.CheckUserGroup'); //script include name
ga.addParam('sysparm_name', 'getgroup'); //function name
ga.addParam('sysparm_name_sysid', sysid); //passing sysid to server
ga.getXMLAnswer(getGroup);
function getGroup(response) {
if (response == 'true') {
g_form.addInfoMessage('Part of group');
g_form.setValue('contact_type','dlp');
g_form.setReadOnly('contact_type',true); // If you want to restrict the field from changing value
} else {
g_form.addInfoMessage(response);
g_form.addInfoMessage('Not Part of group');
g_form.setValue('contact_type', '');//Keep blank
g_form.setReadOnly('contact_type',true); // If you want to restrict the field from changing value
}
}
}
SCRIPT INCLUDE:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 10:42 PM
Hi @Talari Balateja ,
Script is taking the login user. Please try after impersonating the user who is present in that group.
Impersonating an user will solve your issue.
Thanks!
Abhishek Dalvi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 04:15 AM
Hi @Talari Balateja ,
Can you try the same with below syntax in your script include 2nd line.
CheckUserGroup.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
Thank you!
Abhishek Dalvi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 10:37 PM
it's showing error, even the part of that particular group and after that I added myself as user from that particular group. then it's working fine but for the existed users it's not working. I'm I created function in right way? why it's showing error like this.
EXISTING USERS:
FOR ME:
CLIENT SCRIPT:
function onLoad() {
var sysid = g_user.userID; //get current user sysid
var ga = new GlideAjax('sn_si.CheckUserGroup'); //script include name
ga.addParam('sysparm_name', 'getgroup'); //function name
ga.addParam('sysparm_name_sysid', sysid); //passing sysid to server
ga.getXMLAnswer(getGroup);
function getGroup(response) {
if (response == 'true') {
g_form.addInfoMessage('Part of group');
g_form.setValue('contact_type','dlp');
g_form.setReadOnly('contact_type',true); // If you want to restrict the field from changing value
} else {
g_form.addInfoMessage(response);
g_form.addInfoMessage('Not Part of group');
g_form.setValue('contact_type', '');//Keep blank
g_form.setReadOnly('contact_type',true); // If you want to restrict the field from changing value
}
}
}
SCRIPT INCLUDE:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 10:42 PM
Hi @Talari Balateja ,
Script is taking the login user. Please try after impersonating the user who is present in that group.
Impersonating an user will solve your issue.
Thanks!
Abhishek Dalvi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 11:02 PM
Yeah, I have impersonated with that group user's only it's showing that he not part of that group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 11:09 PM
@Talari Balateja , Try adding some logs and info messages. You are getting response blank for existing user.
Abhishek Dalvi