- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2017 02:13 AM
How we can Restrict certain groups in ServiceNow to only P1 and P2 incidents can assigned to particular group
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 02:11 AM
Thanks Vivekanand and Dave for clarifying the Requirement.
You can write an On Submit Client Script to restrict the same as shown below for a particular Group:
So the above Script Restricts the User from Submitting the High Priority Ticket to the Cab Approval Group for example whose Sys Id has been mentioned in the Screen shot above.
Similarly if there are few Assignment Groups you cna give an OR condition in the Script above in line Number 7 as mentioned below:
if(group =='b85d44954a3623120004689b2d5dd60a' || group == 'a715cd759f2002002920bde8132e7018')
Another Scenario can be where you have Multiple Groups for which you want to check the Validation then instead of using multiple Sys id's directly in a Client Script you can create a System Property and define your Assignment Group Sys Id in the Property and can use them multiple times using a Server Side Script to have the same Validation as explained Below:
Step 1:
Create A System Property by typing "sys_properties.list" from Application Navigator Search and click on New Button as shown below:
For example I have created a Property called "get_groups" where I have defined Sys Id of the multiple Assignment Groups as shown below:
Step 2:
Once the System Property has been defined, Create a Before Insert/Update Business Rule on the incident Table with Conditions as Priority is One of Critical or High and as per the script below:
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var grp1 = [];
var grp =gs.getProperty('get_groups');
grp1 =grp.split(',');
for(var k=0; k < grp1.length; k++)
{
var gr = new GlideRecord('incident');
gr.addQuery('sys_id',current.sys_id);
gr.addQuery('assignment_group',grp1[k]);
gr.query();
if(gr.next())
{
gs.addInfoMessage('Invalid Submission for Priority 1 and Priority 2 Tickets for the Assignment Group selected');
current.setAbortAction(true);
}
}
})(current, previous);
Have tested and is working for me on my Personal Instance. Kindly test the same from your end too.
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 10:10 AM
Hi Vivekanand,
Glad to hear your issue got Resolved.
Would you mind marking the answer as correct and close the thread so that the question can also be removed from Unanswered List.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2017 12:24 AM
Hi Shloke,
How we can mark answer as correct and i am not seeing any option.
Please suggest here.
Regards,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2017 12:34 AM
Hi,
Since you are the author of the Question you would find an button as "Correct answer" for my Response. Please refer the thread also on how to mark Answer as correct:
How To Mark Answers Correct From Community Inbox
Regards,
Shloke
Regards,
Shloke