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

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.

Nani18
Tera Contributor

Hello Basheer,

 

Thanks for your help 

 

Above script is working fine . and I need to add one more condition in the script  in incident form security incident select box is false and category is not security it wont allow to save the incident. How to do this 

 

and main problem is error message is showing in Platform and portal as well . I need only in platform .

 

Best Regards, 

Gnani

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.

Nani18
Tera Contributor

Hello Basheer ,

 

How we can restrict error message in Service portal .