Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Mastering ServiceNow Scripting
  • Toc
  • feedback
Mastering ServiceNow Scripting

Mastering ServiceNow Scripting

By : Kindred
3.4 (7)
close
Mastering ServiceNow Scripting

Mastering ServiceNow Scripting

3.4 (7)
By: Kindred

Overview of this book

Industry giants like RedHat and NetApp have adopted ServiceNow for their operational needs, and it is evolving as the number one platform choice for IT Service management. ServiceNow provides their clients with an add-on when it comes to baseline instances, where scripting can be used to customize and improve the performance of instances. It also provides inbuilt JavaScript API for scripting and improving your JavaScript instance. This book will initially cover the basics of ServiceNow scripting and the appropriate time to script in a ServiceNow environment. Then, we dig deeper into client-side and server-side scripting using JavaScipt API. We will also cover advance concepts like on-demand functions, script actions, and best practices. Mastering ServiceNow Scripting acts as an end-to-end guide for writing, testing, and debugging scripts of ServiceNow. We cover update sets for moving customizations between ServiceNow instances, jelly scripts for making custom pages, and best practices for all types of script in ServiceNow. By the end of this book, you will have hands-on experience in scripting ServiceNow using inbuilt JavaScript API.
Table of Contents (14 chapters)
close

Script examples

Now we've looked at some server- and client-side Glide classes, we can take a look at some examples of using these methods and properties in some slightly more complex blocks of code to achieve our goals in ServiceNow.

Let's start by having a look at some GlideRecord examples.

This time, we'll use GlideRecord multiple times, one inside another. This is a technique you will no doubt use quite often as you progress with your scripting. It has certainly served me well over the years.

In this example, we'll take a look at creating a problem record for every critical priority incident:

var incRec = new GlideRecord('incident');
incRec.addQuery('priority', 1);
incRec.query();
while (incRec.next()) {

//Critical incident found, create a new problem record
var newProblemRec = new GlideRecord('problem');
newProblemRec...
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete