O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering ServiceNow Scripting

Book Description

Understand the ServiceNow scripting and build an efficient customized ServiceNow instance

About This Book
  • Customize your ServiceNow instance according to your organization's needs
  • Learn to work with inbuilt JavaScript APIs in ServiceNow
  • Take your ServiceNow experience to the next level by learning to script
Who This Book Is For

This book is targeted toward ServiceNow administrators or anyone willing to learn inbuilt JavaScript APIs used to script and customize ServiceNow instances. Prior experience with ServiceNow is required.

What You Will Learn
  • Customize your ServiceNow instance according to your organization's needs
  • Explore the ServiceNow-exposed JavaScript APIs and libraries
  • Discover the method for using ServiceNow scripting functions
  • Take your ServiceNow experience to the next level by understanding advanced scripting
  • Learn to build, test, and debug custom applications
  • Use your customized instance efficiently with the help of best practices
In Detail

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.

Style and approach

The book will take a practical approach delving into different aspects of ServiceNow scripting to help you become a scripting master.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://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. Title Page
  2. Copyright and Credits
    1. Mastering ServiceNow Scripting
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
    5. Disclaimer
  6. Getting Started
    1. Configuration versus customization
    2. To script or not to script?
    3. Types of script
    4. Script execution
    5. Introduction to scripting
    6. Script editor
    7. Summary
  7. Exploring the ServiceNow Glide Class
    1. Using ServiceNow exposed JavaScript APIs
      1. GlideRecord
    2. Server-side Glide classes
      1. GlideSystem
      2. GlideDateTime
      3. GlideElement
      4. GlideAggregate
    3. Client-side Glide classes
      1. GlideForm
      2. GlideUser
      3. Additional client-side Glide classes
    4. Script examples
    5. Summary
  8. Introduction to Client-Side Scripting
    1. Client scripts
      1. onLoad
      2. onChange
      3. onSubmit
      4. onCellEdit
    2. UI policies
    3. How and when to write client-side scripts
      1. Making fields mandatory, visible, or read-only
      2. Populating fields based on the value of another field
      3. Showing/hiding form sections
      4. Review
    4. Testing client-side scripts
      1. Alert
      2. Jslog
      3. Browser
    5. Script examples
    6. Summary
  9. Advanced Client-Side Scripting
    1. UI actions
      1. Client-side UI actions
      2. Calling server-side script
    2. AJAX calls
      1. Client-side AJAX
      2. Server-side AJAX 
    3. Script examples
    4. Summary
  10. Introduction to Server-Side Scripting
    1. Business rules
    2. UI actions
    3. Access controls
    4. How and when to write server-side scripts
      1. Changing form values
      2. Restricting access to forms and fields
      3. Passing values to the client side
      4. Review
    5. Testing server-side scripts
      1. gs.log
      2. Logging in scoped applications
      3. Session debug
      4. Script debugger
    6. Script examples
    7. Summary
  11. Advanced Server-Side Scripting
    1. Script includes
    2. Scheduled jobs
    3. Background scripts
    4. Workflow scripts
    5. Event management
    6. Script actions
    7. Script examples
    8. Summary
  12. Introduction to Custom Pages
    1. Introduction to Jelly
    2. UI pages
    3. Script examples
    4. Summary
  13. Scripting with Jelly
    1. Jelly scripting
      1. Evaluate
      2. If
    2. UI macros
    3. Script examples
    4. Summary
  14. Debugging the Script
    1. The script debugger
    2. The session debugger
    3. The Field Watcher
    4. Debugging applications
    5. The JavaScript Log and Debug window
    6. Debugging REST
    7. SOAP debugging
    8. Summary
  15. Best Practices
    1. Coding best practices
    2. Business rule best practices
      1. Before
      2. After
      3. Async
      4. Display
    3. Client script best practices
    4. Debugging tools best practices
      1. Logging
      2. Session debug
    5. Logs and queues best practices
      1. Logs
      2. Queues
        1. Event queue
        2. System scheduler
        3. ECC queue
    6. System performance best practices
    7. Summary
  16. Deployments with the Update Sets
    1. When to use update sets
    2. How to use scope with update sets
    3. Transferring update sets between instances
    4. Update set pitfalls
    5. Update set best practices
    6. Summary
  17. Building a Custom Application Using ServiceNow Scripting
    1. Creating a custom application with ServiceNow scripting
      1. Creating the application
      2. Building the application
      3. Example application
    2. End-to-end development
      1. Studio
      2. Application development
      3. Example application
    3. Testing
      1. Example application
    4. Deployment
      1. Publish to an update set
      2. Publish to the application repository 
      3. Publish to the ServiceNow store
      4. Example application
    5. Summary
  18. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think