In incident form short description or description contains keywords ("phish" "hack" "theft") Alert

Nani18
Tera Contributor

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

2 ACCEPTED SOLUTIONS

Basheer
Mega Sage

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 hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

View solution in original post

Hi @Nani18 

Where do you want this to be added.

else if(category != "security" && securityIndex == false){
//write your code here
}
Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

View solution in original post

6 REPLIES 6

Please use gs.flushMessages()

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

ricker
Tera Guru

@Nani18,

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?