You are on page 1of 30

Book Description

Conquer ServiceNow by getting to grips with the power behind the platform
In Detail
This book will help you to understand the fundamentals behind the ServiceNow
platform. Throughout the book, we develop a simple example application that is
designed to highlight the key capabilities of ServiceNow.
In the initial chapters, we build our foundations, walking through the data model,
exploring how to write effective code to implement business logic, and avoiding the
pitfalls that come with flexibility and choice in client-side scripting.
Then, we explore the Task table, a powerful kick-start to any application. To head off
potential problems, we look at debugging and diagnosis techniques. And finally, we
think about automation and orchestrationhow ServiceNow can help control the rest of
your IT environment. Packed with hints, tips, and examples, this book helps you to
master ServiceNow quickly and efficiently.
What You Will Learn
Dig into the foundations of the ServiceNow platform and build powerful custom
applications
Design feature-rich, responsive, automated workflow systems
Leverage the vast capabilities of ServiceNow to super-power your business
Design powerful data-driven applications
Control information flow and apply business logic with Business Rules
Write efficient and effective client-side JavaScript
Explore the working of the Task table
Integrate and exchange data with people and systems
Create and secure your systems with proper access control
Discover and automate other IT systems

Downloading the example code for this book. You can download the example code files
for all Packt books you have purchased from your account athttp://www.PacktPub.com.
If you purchased this book elsewhere, you can
visit http://www.PacktPub.com/support and register to have the files e-mailed directly
to you.

Table of Contents
1. Mastering ServiceNow
1. Table of Contents
2. Mastering ServiceNow
3. Credits
4. About the Author
5. About the Reviewers
6. www.PacktPub.com
1. Support files, eBooks, discount offers, and more
1. Why subscribe?
2. Free access for Packt account holders
3. Instant updates on new Packt books
7. Disclaimer
8. Preface
1. What is in this book
2. What you need for this book
3. Who this book is for
4. Conventions
5. Reader feedback
6. Customer support

1. Downloading the example code


2. Errata
3. Piracy
4. Questions
9. 1. ServiceNow Foundations
1. Diving into the infrastructure
1. Being in charge
2. Changing your instance
3. Choosing functionality with plugins
4. Digging into hosting
5. Knowing the nodes
2. Exploring the database
1. Introducing the Gardiner Hotel data structure
2. Creating tables
1. Adding fields
2. Knowing what's happening
3. Introducing the dictionary
4. The Globally Unique Identifier
3. Building hierarchical tables
1. Benefiting from an object-oriented design
2. Extending the User table
3. Interacting with hierarchical tables
4. Viewing hierarchical tables

5. Overriding field properties


6. Understanding the background behavior
1. Changing class
4. Storing data
1. Attachments
2. Setting properties
5. Reference fields
1. Creating a reference field
2. Using Reference Qualifiers
3. Dot-walking
1. Using derived fields
4. Dynamic creation
5. Deleting records
6. Many-to-many relationships
1. Building a many-to-many table
1. Adding fields to a many-to-many table
2. Deleting a many-to-many table
2. Glide Lists
7. Building the interface
1. Lists
1. Choosing the fields to show
2. Having reference fields on lists
3. The varied capabilities of lists

2. Forms
1. Creating useful forms
2. Adding related and embedded lists
3. Defining your own Related Lists
3. Creating tags and bookmarks
1. Adding a bookmark
2. Defining a tag
4. Enjoying views
1. Controlling views
5. Menus and modules
1. Specifying a view
2. Setting a filter
3. Building the right modules
8. Summary
10. 2. Server-side Control
1. A brief history of JavaScript
2. Running background scripts
3. Rhino the JavaScript engine powering ServiceNow
1. Accessing Java
2. Appreciating server-side code
1. Comparing engine speed
4. Using GlideRecord (and its friends)
1. Accessing data from GlideRecord

2. Walking through reference fields


3. Converting data types
1. The surprising results of GlideElement
2. Getting the value another way
4. Dealing with dates
5. Counting records with GlideAggregate
6. Business Rules
1. Predefined variables
2. Setting the table
1. Displaying the right table
3. Conditioning your scripts
1. Having good conditions
4. Controlling the database
1. Controlling database queries with Business Rules
5. Choosing when to execute before, after, and really after
1. Defaulting data
2. Validating information
3. Working with dates
4. Updating information
5. Running things later with system scheduling
6. Display Business Rules
7. Preventing colliding code
1. Global Business Rules

8. Script Includes
1. Creating classes
1. Coding a class
2. Using classes to store and validate data
2. Extending classes
1. Extending the class example
3. Utility classes
1. Providing utility classes
4. Storing functions
1. Having functions in Script Includes
5. Client Callable Script Includes
9. Special function calls
1. Specifying the view using code
10. Enforcing a Data Policy
1. Forcing a comment using Data Policy
2. Specifying dynamic filters
1. Showing Guests that are 'Me'
11. Scripting Reference Qualifiers
1. Showing only guests with reservations
12. Summary
11. 3. Client-side Interaction
1. Building a modern interface
1. A microsecond of Human Computer Interaction

2. The power and pitfalls of AJAX


2. Choosing a UI Action
1. Finding the current table
2. Displaying UI Actions at the right time
1. Using the Condition field
3. Running client- or server-side code
1. Saving and redirecting
4. Converting a record from Reservation to Check-in
3. Running the client-side script
1. Proving the basics
2. Meeting GlideRecord again
3. Making synchronous AJAX
1. The defined function
2. The anonymous function
3. Using callbacks effectively
4. Single set of data
5. Avoiding GlideRecord
4. Managing fields with a UI Policy
1. Manipulating the form
1. Client-side conditioning
2. Forcing a comment on reservations
3. Controlling UI Policies
5. Manipulating the form with GlideForm

1. Using GlideForm
2. Choosing a UI Policy
6. Meeting Client Scripts
1. Sending alerts for VIP guests
2. Changing, submitting, loading, and more
3. Validating the contents of fields
4. The disappearance of current
5. Translating client scripts
7. Efficiently transferring data to the client
1. Writing a Script Include for GlideAjax
2. Using GlideAjax
3. Passing data when the form loads
1. Creating a Display Business Rule
2. Using scratchpad on the client
4. Storing data in the session
8. Controlling lists with Context Menus
1. Finding out about the list
2. Opening a new tab
9. Customizing and extending the platform
1. Firing on more events
2. Using built-in libraries
3. What could go wrong
10. Taking control of the browser

1. Data Policy saves the day


11. Summary
12. 4. Getting Things Done with Tasks
1. Introducing tasks
1. Looking at the Task table
1. The important fields
2. Populating fields automatically
2. Recording Room Maintenance tasks
3. Working with tasks
1. Working without a queue
2. Working socially
3. Organizing groups and users
1. Creating a room maintenance team
2. Creating a property
3. Using departments and companies
4. Using Additional comments and Work notes
2. Understanding the State field
1. Breaking down states
2. Configuring different states
3. Navigating between states
4. Creating room maintenance states
1. Enforcing on the server
2. Adding a Reference Qualifier

3. Removing states with Client Scripts


5. Automating an assignment based on state
1. Using Data Lookup
1. Setting the Assignment group with Assignment
Rules
3. Drag-and-drop automation with Graphical Workflow
1. Running a workflow
1. Exploring under the covers
2. Appreciating activities
3. Using data-driven workflows
4. Approving tasks
1. Making the decision
2. Understanding what you are approving
3. Asking for approval for the repair team
1. Performing the approval
2. Starting up the workflow
3. Monitoring progress
5. Using the Service Catalog
1. The different types of Catalog Items
2. Creating a Record Producer
1. Adding more information
2. Routing the submitted request with templates
3. Testing the Record Producer

3. Understanding the data behind the Service Catalog


1. Comparing records and Catalog Items
6. Understanding Request Fulfilment
1. Checking out
2. Using the request tables
1. Scripting variables
7. Service Level Management
1. Exploring the SLA data structure
2. Timing an SLA
3. Travelling through time
1. Enjoying relativity
1. Scheduling and time zones
4. Customizing condition rules
5. Avoiding a breach
1. Working SLAs
6. Ensuring maintenance is quick
8. Summary
13. 5. Events, Notifications, and Reporting
1. Dealing with events
1. Registering events
2. Firing an event
1. Sending an e-mail for new reservations
2. Scheduling jobs

1. Adding your own jobs


1. Creating events every day
2. Running scripts on events
1. Creating tasks automatically
3. Sending e-mail notifications
1. Setting e-mail properties
2. Tracking sent e-mails in the Activity Log
3. Assigning work
1. Sending an e-mail notification on assignment
1. When to send
2. Who will receive
1. Send to event creator
3. What it will contain
1. Using variable substitution
2. Running scripts in e-mail messages
3. Controlling the watermark
4. Including attachments and other options
4. Sending informational updates
1. Sending a custom e-mail
1. Enabling the e-mail client
2. Sending e-mails with Additional comments and Work
notes
1. Sending out Work notes

5. Approving via e-mail


1. Using the Approval table
2. Testing the default approval e-mail
6. Specifying Notification Preferences
1. Subscribing to Email Notifications
2. Creating a new device
3. Sending text messages
4. Delivering an e-mail
1. Knowing who the e-mail is from
5. Receiving e-mails
1. Determining what an inbound e-mail is
2. Creating Inbound Email Actions
1. Accessing the e-mail information
2. Approving e-mails using Inbound Email Actions
1. Understanding the code in Update Approval
Request
3. Updating the Work notes of a Maintenance task
3. Having multiple incoming e-mail addresses
1. Using the Email Accounts plugin
2. Redirecting e-mails
3. Processing multiple e-mail address
6. Recording Metrics
1. The difference between Metrics and SLAs

2. Running Metrics
1. Scripting a Metric Definition
2. Monitoring the duration of Maintenance tasks
7. Flattening data with Database Views
1. Creating a Metric Instance Database View
8. Reporting
1. The functionality of a list
2. Using reports elsewhere
1. Sending a shift handover report
3. Analytics with ServiceNow
1. Basic trending with Line Charts
2. Performance Analytics
4. Making sense of reports
1. Ensuring consistency
2. Using outside tools
9. Building homepages
1. Creating a Maintenance homepage
2. Making global homepages
1. Editing homepages
3. Counting on a homepage
4. Optimizing homepages
10. Summary
14. 6. Exchanging Data Import Sets, Web Services, and Other Integrations

1. Beginning the Web Service journey


1. Pulling data out of ServiceNow
2. Downloading file-based data
1. Automatically download data using cURL
1. Installing cURL
2. Downloading the Excel spreadsheet
3. Using more URL parameters
1. Choosing the fields
2. Specifying the records
4. Pulling data designed for the Web
1. Feeding tasks into an RSS reader
2. Cleaning up with SOAP Direct Web Services
1. Using Direct Web Services
2. Filtering the response
3. Returning display values
3. Grabbing JSON
4. Using REST
1. Retrieving data
2. Manipulating other data
2. Bringing it in using Import Sets
1. Specifying the Data Source
1. Creating an Import Set Table
2. Cleaning up Import Set Tables

3. Dealing with XML files


2. Getting data
3. Transforming the data
1. Creating a Field Map
1. Enabling Scripting in Transform Maps
2. Creating new values
3. Dealing with times
4. Importing into reference fields
2. Scripting in Transform Maps
1. Knowing when scripting will run
3. Posting data to an Import Set
4. Keeping Import Sets running
3. Importing users and groups with LDAP
1. Importing users from an LDAP server
1. Reviewing the configuration
2. Altering the Transform Maps
4. Building Web Service Import Sets
1. Using a Web Service Import Set WSDL
5. Connecting to Web Services
1. Creating tasks after assignment
1. Testing the Web Service
2. Sending the message
2. Using SOAPMessage effectively

3. Building REST Messages


6. Building custom interfaces
1. Creating Scripted Web Services
1. Doing multiplication with a Scripted Web Service
2. Introducing Processors the ultimate in flexibility
1. Creating a custom processor interface
2. Building a processor
3. Hosting a custom WSDL
7. Integrating with the ECC Queue
1. Using the ECC Queue
8. Introducing the MID server
1. Picking up jobs
2. Installing the MID server
1. Setting up the server
3. Using the MID server
1. Running a custom command
4. Running JavaScript on the MID server
1. Using MID server Background Scripts
2. Interacting with the ECC Queue
3. Working with parameters and MID server Script
Includes
1. Creating a MID Server Script Include
4. Using Java on the MID Server

1. Adding additional libraries


9. Authenticating and securing Web Services
10. Designing integrations
1. Transferring bulk data
2. Real-time communication
3. Communicating through the firewall
11. Summary
15. 7. Securing Applications and Data
1. Understanding roles
1. Defining a role
2. Assigning roles to users
3. Differentiating between requesters and fulfillers
4. Using impersonation
5. High Security Settings
1. Elevating security
6. Controlling access to applications and modules
1. Controlling access to modules with groups
2. Protecting data with Contextual Security
1. Understanding Contextual Security
2. Specifying rows and fields to secure
1. Securing rows
3. Controlling fields
4. The order of execution

1. Executing the row and then the field


2. Rules are searched for until one is found
3. Defaults are possible
4. The table hierarchy is understood
5. Multiple rules with the same name are both
considered
6. Field rules check the table hierarchy twice
5. Summarizing the execution
6. Scripting and Access Controls
7. Securing other operations
8. Outlining the scenarios
9. Conditioning Contextual Security
1. Editing the automatic security rules
2. Testing using impersonation
3. Setting security rules quickly
4. Scripting a security rule
10. Using security rules effectively
3. Encrypting data
1. Evaluating encryption gateways
4. Introducing Domain Separation
1. Defining a domain
1. Applying Domain Separation
2. Organizing domains

1. Introducing global
2. Understanding domain inheritance
3. Turning on Domain Separation
3. Setting domains
4. Exploring domain visibility
5. Understanding Delegated Administration
6. Overriding configuration
1. Displaying different messages for different domains
7. Creating more domain relationships
8. Using Domain Separation appropriately
5. Authenticating users
1. Using internal authentication
2. Controlling authentication
3. Using an LDAP server for authentication
4. Enabling Single Sign On through SAML
1. Logging out
2. Configuring Single Sign On
5. Navigating to the side door
6. Preventing access to the instance
6. Securing Web Services
1. Using WS-Security
1. Improving security with signatures
2. Mutual authentication

1. Setting up outbound Mutual Authentication


7. Summary
16. 8. Diagnosing ServiceNow Knowing What Is Going On
1. Building a methodology
1. Identifying the issue
2. Looking at the System Log
1. Writing to the System Log
2. Using the file log
3. Logging appropriately
3. Using the debugging tools
1. Debugging Business Rules
2. Debugging Contextual Security Rules
4. Enabling the JavaScript Debugger
1. Controlling Business Rules on the fly
2. Seeing client-side messages
1. Logging to the JavaScript Log
3. Watching fields
1. Finding out what set the Assignment group
5. Tracking each page request
1. Recording the time taken
1. Monitoring the instance's performance
2. Recording the browser's perspective
1. Breaking down the browser's time

6. Going through other logs


7. Finding slow database transactions
1. Classifying slow queries
2. Examining the Slow Query log
1. Understanding behavior
3. Seeing the plan
8. Dealing with other performance issues
1. Managing large tables
1. Archiving data
2. Rotating and extending through sharding
1. Choosing table extension
2. Selecting table rotation
9. Auditing and versioning
1. Turning on auditing
2. Viewing audit
3. Using auditing responsibly
4. Versioning configuration
1. Reviewing the changes
10. Optimizing hardware resources
1. Controlling resources with semaphores
11. Accessing the system internals
1. Understanding the ServiceNow Performance homepage
2. Flushing the system cache

3. Accessing system stats


12. Summary
17. 9. Moving Scripts with Clones, Update Sets, and Upgrades
1. Using your instances
2. Serializing records to XML
1. Exporting and importing serialized XML
2. Transporting data via XML
3. Recording configuration in Update Sets
1. Capturing configuration
1. Transferring an Update Set
2. Applying an Update Set
1. Understanding multiple Update Sets
2. Relying upon other updates
3. Managing Update Sets
1. Using the wrong Update Set
4. Working with Workflows
1. Having the wrong IDs
5. Backing out Update Sets
6. Moving away from Update Sets
4. Cloning instances
1. Preserving and excluding data
2. Using clones effectively
5. Packaging with the App Creator

1. Creating applications quickly


2. Exporting an application to an Update Set
3. Versioning records
4. Capturing configuration
6. Synchronizing with Team Development
1. Having a parent
2. Comparing instances
3. Using the Team Dashboard
1. Pulling changes
1. Dealing with collisions
2. Pushing updates
3. Working with multiple development instances
4. Deciding between Update Sets and Team Development
7. Sharing with Share
8. Adding more with plugins
1. Activating plugins
2. Choosing the right plugin
9. Upgrading ServiceNow
1. Understanding upgrades
1. Configuration and Customization
1. Knowing areas of risk
2. Applying upgrades
3. Reverting customizations and restoring out of the box

2. Upgrading instances automatically


10. Managing instances
11. Summary
18. 10. Making ServiceNow Beautiful with CMS and Jelly
1. Designing a portal
1. Giving self-service access
1. Understanding the options
2. Choosing a portal
2. Building a portal with CMS
1. Getting the assets
2. Structuring a site hierarchy
3. Designing the Pages
4. Finalizing the mock-ups
5. Configuring the pages
1. Making a div-based layout
2. Setting the Site
3. Creating a Page
1. Finding the right page
4. Including the content
5. Adding some style
6. Copying pages
7. Styling the form
8. Creating a Self-Service form

9. Adding more pages


10. Populating the menus
1. Configuring the main menu
2. Making the header menu
11. Locking down the data
1. Checking the room
2. Filtering Maintenance tasks
3. Altering Access Controls
12. Testing the site
3. Creating truly custom pages
1. Creating a UI Page
2. Adding interactivity to UI Pages
3. Including UI Macros
4. Dynamically creating content with Jelly
1. Touching on XML
2. Looping with Jelly
3. Expanding on Jelly
4. Accessing Jelly and JavaScript variables
1. Mixing variables
2. Using JEXL and escaping
3. Setting Jelly variables
5. Caching Jelly
6. Mixing your phases

5. Using Jelly in the CMS


1. Using Dynamic Blocks
2. Specifying Content Types
1. Creating CMS Lists
2. Building Detail Content
3. Understanding the link structure
4. Improving lists and forms
5. Final testing
6. Including Jelly in the standard interface
1. Adding Formatters
2. Decorating and contributing to fields
3. Launching a dialog box
1. Launching UI Pages with GlideDialogWindow
2. Fitting in a form
3. Displaying any page with GlideBox
7. Summary
19. 11. Automating Your Data Center
1. Servicing the business
1. Discovering devices
2. Building relationships
3. Using the BSM in ServiceNow
4. Storing relationships and CIs
1. Visualizing the extensions

2. Linking the CIs together


3. Separating relationships and classes
2. Building your own BSM with Discovery
1. Remembering the MID server
2. Performing the Disco steps
3. Finding devices with Shazzam
1. Configuring IP addresses for Shazzam
1. Automatically finding IP addresses
2. Shouting out Shazzam
1. Configuring Shazzam
4. Classifying CIs
1. Sensing the classification
2. Classifying other devices
3. Dealing with credentials
5. Identifying the CI
1. Getting the right information
2. Performing identification
6. Exploring the CI
1. Understanding exploration probes
2. Creating custom probes and sensors
1. Relating CIs together
3. Ensuring high-quality data
4. Associating CIs to Business Services

1. Using APD
7. Summing up Discovery
8. Automating services with Orchestration
1. Automating password resets with Orchestration
1. Running the Automation workflow
2. Running custom commands
9. ServiceNow Cloud Provisioning
1. Introducing virtual machines
2. Requesting a virtual machine with Cloud Provisioning
10. Configuration Automation
1. Controlling servers with Puppet
1. Creating the catalogs
2. Configuring Puppet and ServiceNow
2. Cooking with Chef
1. Folding Chef into ServiceNow
3. Running Configuration Automation
11. Summary
20. Index

You might also like