- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 05:42 AM
Hello Experts
If any incident is on New or assigned state and assignment group is AB and short description or description field contains "phish" "hack" "theft" words then display an error message. error message is '' Ticket contains security related content. Please check if this incident is IT Security related and update the ticket category accordingly".
If incident category is not security then we need to restrict to update the form and display error message. and
If incident category is updated to security then restriction not needed on update or save.
help me to achieve this.
Best Regards,
Gnani
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 06:03 AM
Hi @Nani18 ,
If you are trying to achieve this through BR then follow below thing
Ideally state and group can be kept in when to run condition but if you need it in scripting there as well you can use them.
var state = current.state; // this will give you the state
var group = current.assignment_group; //this will give you the group sys_id
var category = current.category; //this will give you the category
var notes = current.work_notes; //this will give you the work notes; specify correct column name whether it is work_notes or additional_comments or comments as per your requirement
if(state == "1" || state == "2" && group = "AB" && category = "security"){ //the condition is just reference for you
if(notes.includes("phish") || notes.includes("hack") || notes.includes("theft")){
gs.addErrorMessage("Ticket contains security related content. Please check if this incident is IT Security related and update the ticket category accordingly")
}
}
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 02:53 AM
Hi @Nani18
Where do you want this to be added.
else if(category != "security" && securityIndex == false){
//write your code here
}
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 03:08 AM
Please use gs.flushMessages()
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 10:14 AM
Where and when do you want to do this? When the form is being filled out? Then you want to use onChange script or UI Policy on the form to alert the user and set requirements as needed.
When it's saved to the DataBase? Who should be notified? At a different time?