Learning ServiceNow
eBook - ePub

Learning ServiceNow

Tim Woodruff

Buch teilen
  1. 356 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Learning ServiceNow

Tim Woodruff

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

IT Service management at your fingertipsAbout This Book• Leverage ServiceNow's capabilities to achieve improved service management and excellent results in your IT operations by following step-by-step, practical instructions• Build core administration, management, and maintenance skills with IT service management and IT operations management• Improve your workflow efficiency by designing and creating responsive and automated workflowsWho This Book Is ForThis book is for IT professionals and administrators who are planning to or are already trying to implement ServiceNow in their organization for Enterprise IT service management tasks.Some familiarity with web technologies (JavaScript) would be helpful. System administration experience is necessary.What You Will Learn• Acquire and configure your own free personal developer instance of ServiceNow• Read (and write!) clear, effective requirements for ServiceNow development• Avoid common pitfalls and missteps that could seriously impact future progress and upgradeability• Know how to troubleshoot when things go wrong using debugging tools• Discover developer "tips and tricks"• Pick up great tips from top ServiceNow development and administration professionals, and find out what they wish they knew when they were starting outIn DetailThis book shows you how to put important ServiceNow features to work in the real world. We will introduce key concepts and examples on managing and automating IT services, and help you build a solid foundation towards this new approach. We'll demonstrate how to effectively implement various system configurations within ServiceNow. We'll show you how to configure and administer your instance, and then move on to building strong user interfaces and creating powerful workflows.We also cover other key elements of ServiceNow, such as alerts and notifications, security, reporting, and custom development. You will learn how to improve your business' workflow, processes, and operational efficiency. By the end of this book, you will be able to successfully configure and manage ServiceNow within your organization.Style and approachThis book is a step-by-step practical tutorial to help you quickly deploy and configure ServiceNow in your organization.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Learning ServiceNow als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Learning ServiceNow von Tim Woodruff im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatik & Unternehmensanwendungen. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2017
ISBN
9781785887536

The Server-side Glide API

In 2003, CEO Fred Luddy started a company called GlideSoft, which specialized in IT Service Management applications. Three years later, the company changed its name to ServiceNow, but the Glide name stuck for the API!
The Glide API is available on both the server and the client (though only a subset of the API is available on the client), and it consists largely of several classes about which we'll learn in this chapter; several of which are:
  • Server-side Glide classes:
    • GlideRecord
    • GlideAggregate
    • GlideElement
    • GlideDate and GlideDateTime
    • GlideSession
    • GlideSystem
  • Client-side Glide classes:
    • GlideRecord
    • GlideAjax
    • GlideForm
    • GlideList2
    • GlideMenu
    • GlideUser
Each class in the Glide API may consist of methods (executable functions within the class), and properties (variables stored within the class, which may be set on initialization of a new instance of the class).
This chapter largely consists of API documentation. We recommend that you read through it once, and then dog-ear this chapter so that you can come back to it for reference later on.

The structure of an API class

First, let's define a few terms. According to Mozilla's object-oriented JavaScript documentation, a class is sort of like a template for an object. It pre-defines the methods and properties of an object generated from the class.
An object therefore, is simply an instance of a class!
A method is a function or subroutine that's declared as part of a class (and any objects that are instances of that class).
A constructor is a special type of function that runs when an object is declared as a new instance of a class using the new keyword. In ServiceNow, this constructor function is usually called initialize. Any arguments passed into the class during instantiation will be passed into this function, which effectively builds the object that will be returned.
Naming convention dictates that while variable names use camelCase capitalization, class names use SentenceCase capitalization.
Here is a simple example of what a very simple class might look like:
 var MyClass = Class.create(); 
MyClass.prototype = {
initialize: function(initArg) {
this.localProperty = initArg;
},
getLocalProperty: function() {
return this.localProperty;
},
type: 'MyClass'
};
Now let's break this down line-by-line, and see how it works.
On line 1, we declare our class (MyClass) using a special ServiceNow API, Class.create(). As it happens, JavaScript doesn't technically have a data type called Class. Instead, it relies on function/object prototype extensions. In order to simplify this, and provide syntax more similar to the backend Java (and more similar to what most object-oriented programming languages use), ServiceNow provides Class.create() as a simple way to generate a basic class-esque object.
On line 2, we take this basic class scaffolding that we generated on line one, and extend that prototype by adding some stuff to it (everything between the curly braces: { and }).
On line 3, we declare the initialize method. This is a special method of our class, which is called automatically whenever a new object is generated (instantiated) from our class using the new keyword like so:
 var myObj = new MyClass('input'); 
Any arguments passed into this instantiation process (the string input in the preceding case), are passed into this initialize method.
Next, on line 4, we set a property in the scope of the instantiated object using the keyword this. In this case, any time we create an instance of this class, the property called localProperty will be initialized with the value that was passed into the constructor function.
On line 6, we declare another method called getLocalProperty. This is a method that can be called from objects created from our class, and which (on line 7) returns the value of the property that was set on initialization.
Finally, on line 9, we declare the type property of our class (and instantiated objects). This is just a string that you can access to determine what class child objects were created from.

Server-side APIs

Server-side APIs consist of classes and methods that are available to scripts executing on the server. When a script executes on the server, it is able to do so because of an open-source implementation of JavaScript, written in the Java programming language, called Mozilla Rhino. This allows us to interact with Java applications such as ServiceNow by scripting in JavaScript, despite the fact that the languages are not inherently cross-compatible.

GlideRecord

The GlideRecord class is one of the most ubiquitous and useful classes in ServiceNow. Its primary function is to query a database table, and present values corresponding to each record in that table, that matches a given query. It can also be used to add, modify, or delete records. A GlideRecord object consists of properties with names corresponding to each field in the table. In the client-side Glide API, these properties usually contain strings, whereas on the server-side API, these properties contain GlideElement JavaScript Objects with their own methods and properties.

Initialize

A GlideRecord object must first be initialized by using the new keyword (which calls the initialize() constructor method) and passing in a table name as a string. This tells the new GlideRecord object what table any subsequent queries or new records are created on.

Example usage

Initialize a new GlideRecord object on the Incident table, and store it in the gr variable:
 var gr = new GlideRecord('incident'); 

addQuery()

The addQuery() method of the GlideRecord class can be called in three different ways, depending on whether one, two, or three arguments are supplied to it. If one argument is passed into the addQuery() method, then it'll assume that the argument is an encoded query. Encoded queries are a single string that represents all of the conditions in a single query (or even multiple queries)!
There isn't any official documentation on how to construct an encoded query (though it isn't hard to figure out), but there is a very easy to build one yourself - simply navigate to the table you want to run the query on, and use the query builder! For example, here's a query on the incident table where the "assigned to" user is active, and either the Incident is active, or the state is set to new, in progress, or on hold:
You can build a filter on a given table using the query builder, and then apply that same filter to your GlideRecord query by simply right-clicking the last condition in the query breadcrumbs above the list view, and clicking on Copy query.
This is similar to the legacy addEncodedQuery() method:
You'll see an example of this single-argument usage in the following section. On the other hand, if you pass in two arguments, then it is assumed that the first argument is the field name, and the second argument is the expected value.
Finally, if you pass in three arguments to the addQuery() method, you may specify not only a field and value, but an operator between them. Operators that you can...

Inhaltsverzeichnis