This site is scheduled for a small content update on Tuesday, January 22nd, between the hours of 5:00pm and 8:00pm Pacific Time (Jan 23 01:00 – Jan 23 4:00 UTC). Access to this site may be slightly delayed during that time.

Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Script example

Log in to subscribe to topics and get notified when content changes.

Script example

In this example, the assignment rules use JavaScript code to assign incidents to a particular assignment group based on the incident category.

Table 1. script incident category
This incident category Is assigned to this assignment group
Hardware Hardware
Software Software
Malware Security
Figure 1. Assignment by script
The following script requires configuring the instance to add the Malware category and the Security assignment group.
if(current.category=="Hardware"){
   current.assignment_group.setDisplayValue("Hardware");}elseif(current.category=="Software"){
   current.assignment_group.setDisplayValue("Software");}elseif(current.category=="Malware"){
   current.assignment_group.setDisplayValue("Security");}
Feedback