User Tools

Site Tools


w

Welcome to our JAVASCRIPT PAGE Section W


Web Servers

- The ServiceNow “Nodes” are Tomcat Web Servers and they handle the traffic to the instance. When a user logs in they are directed to an available node which will process and run their requests… - To see the Nodes configured for each Instance, review table sys_cluster_state. - Additional “horsepower” information from ServiceNow Support: - In regards to memory, all application nodes have ~2GB of heap space memory available, regardless of production vs sub-prod. Similarly, CPU is the same across application nodes. - The disk capacity and buffer of the database will increase to accommodate the size of your instance catalog as it grows, so can vary between production and sub-prod, but only because of the difference in data volume and activity, and both instances still have the same capabilities. - The only real differences between instances is the number of nodes, and that production instances have high availability functionality, so have a standby database and nodes in another datacenter acting as a backup.

Widgets

- Takeaway - A Widget is a reusable component (tile) which provides functionality on a Portal page. ServiceNow comes with many widgets, and more can be created. Widgets consist of HTML markup, CSS, a JavaScript controller, and client-side and server-side code. When a portal page is loaded by a web browser, an AngularJS directives is created for each widget on the page. A widget lives inside a Column, inside of a Row, inside of a Container. An Angular “Provider” shares Context between Widgets, keeps Widgets in sync, and maintains State. - A Widget is like a tile for a particular topic/function. - Different roles have access to different Widgets. - Reusable components which make up the functionality of a Portal Page. - ServiceNow provides a large number of baseline widgets. - Widgets consist of HTML markup, CSS, a JavaScript controller, and client-side and server-side code. - Widgets involve AngularJS Directives. When a page is loaded, a directive is created for each widget on the page. - Widgets are tightly coupled to server-side JavaScript code which is powered by the “Rhino” engine under the Now Platform. - After defining a Page's Layout using Containers, Rows, and Columns, you add Widgets to the Page. - The “Move to Header” option pins a widget to the header so that it always stays visible even when the user scrolls down. - Widget Components

  1. HTML Template
    1. Binds client script variables to markup.
    2. Gathers data from user inputs like Text boxes, Radio buttons, and Checkboxes.
  2. Client Script
    1. Defines the AngularJS Controller.
    2. Passes data to the HTML template.
    3. Passes user input and data to the server for processing.
  3. Server Script
    1. Sets the initial Widget state.
    2. Sends data to the Widget's Client Script using the data object.
    3. May access record data and web services.
    4. Runs server-side queries.
  4. Link Function
    1. An optional component which uses AngularJS to directly manipulate the DOM.
  5. Option Schema
    1. An optional component which allows a Service Portal Admin to configure a Widget; that is to define Instance Options.
    2. Specifies the Widget Parameters.
    3. Makes Widgets flexible and reusable.
  6. Angular Provider
    1. Keeps a Widget in sync when changing a record or filter.
    2. Shares Context between widgets.
    3. Maintains and persists state.
    4. Creates reusable behaviors and UI components, then injects them into multiple Widgets.

- ServiceNow provides a large number of Baseline Widgets, including:

  1. Approvals
  2. Carousel
  3. Catalog content
  4. Icon Link - Open another Portal Page. Includes a “Glyph” property which allows you to easily add simple graphics.
  5. Knowledge Base
  6. My Requests
  7. Popular questions
  8. Search

- See Also

Widget Editor

Widget Editor

- Takeaway - The Widget Editor development tool has hideable side-by-side panes for Client Script, CSS, HTML, Server Script, and others. In HTML you might define static markup for display on the web page, invoke Angular directives such as ng-repeat to iterate through arrays passed up from server-side script, and declare event handlers for user actions such as Click. In SERVER SCRIPT you might declare arrays for passing data up to the client, populate them via GlideRecord, and use input from the client. In CLIENT SCRIPT you might declare functions, use those functions to Emit events, declare event handlers, handle events, make calls to the server, via the controller “c”, declare callback functions, and handle callbacks from the server. Widget Development is definitely one of the more intense/complex development topics in ServiceNow, as there are several different technologies involved, and you are working both on the client side and server side. - Modules

Service Portal - Service Portal Configuration - Widget Editor
Service Portal - Pages
Service Portal - Widget Instances

- See Also

AngularJS

- Geoff: Widget Development is definitely one of the more intense/complex development topics in ServiceNow, as there are several different technologies involved, and you are working both on the client side and server side. - The Application for editing Widget Components. - A development tool that allows you to view and edit the source code for existing widgets, create new widgets, and update a widget's option schema. - A parent-child relationship between widgets Only exists if one widget is Embedded inside another widget. - Has the following panes, for side-by-side editing and review:

Client Script
	The following is used to get access to the "controller", "c", which is instantiated automatically:	var c = this;

In order to use classes from the client-side Widget API, the “global” object for each API must be passed as a dependency to the Client Script. The Client Script creates the AngularJS controller using the passed in dependencies. You pass dependencies in the client script function:

function(){...}
	-->
function(spUtil){...}
CSS
Demo Data	

- This is provided as a convenience for testing widgets in the Preview pane. - It overrides any data which may be passed from the server to the client at runtime. - Any number of strings may be defined, separated by commas. - The demo data pane is only visible when the Preview pane is visible.

HTML
Link Function
Preview
Server Script

- Cloning

  1. The process of creating an editable copy of a widget from an existing widget.

- Important: When building a Widget, you normally will start from an existing widget, rather than starting from scratch. - Instructions Filter Navigator - Service Portal Configuration - Widget Editor - [Existing Widget Name]… Hamburger Menu - Clone [Existing Widget Name] - [MyWidgetName] Check “Create Test Page” and give the test page an ID also. Examples:

		request_fields_nh
		request_fields_nh_test_page

To get to the test page, go to Service Portal Configuration - Page Editor - idOfYourNewTestPage https://[InstanceName].service-now.com/sp_config?id=[id of the Widget you just created] - Client Script

  1. Global Objects

data - The serialized data object from the Server Script; or from the object defined in the Widget Editor “Demo Data” pane.

	options		- The options used to invoke the widget on the server.  Read Only.
- Global Functions
	this.server.get() 	- Calls the Server Script and passes in custom input.
	this.server.update() 	- Posts this.data to the Server Script.
	this.server.refresh() 	- Calls the server and automatically replaces the current options and data using the server's response.
APIs Available
- The Web Browser Development Tools (especially the Console) are very useful to use in concert with the Client Script pane.
- Classes
	- spUtil 	- Contains utility methods to perform common functions in a Service Portal widget client script.
		- spUtil.addErrorMessage();
		- spUtil.recordWatch();		- Used to register a "listener" in a widget.  The listener is notified when DB table records change. 
	- spModal - Provides an alternative way to show alerts, prompts, and confirmation dialogs.
		- spModal.alert();
	- console - console.log() - Very useful for debugging.  But consider using jslog() instead, although it only shows messages for admin users.

- Options

  1. Widget Options are admin configurable parameters which allow each widget instance to behave or look differently.
  2. When the admin adds the widget to a Page, he can use the Edit (pencil) icon to set the Widget Options.
  3. The Widget “Option Schema” defines the user-configurable fields. This is available from the Widget Hamburger Menu. Or Ctrl Right Click the widget.
  4. Widget options and their values are stored in the Widget Instances table in JSON format.
  5. Widget options are accessible in both Client and Server Scripts using the “options” global object.

Server Script: options.title = “Hello World”;

	Client Script:	c.options.title = "Hello World";
- Widget options are also accessible in an HTML Template using the "options" global option:
	<h1> {{::c.options.title}}</h1>

- Server Script - Global Objects:

  1. data - Object containing a JSON object, constructed by Server Script, and sent TO the Client Script's “controller”.
  2. input - Data object received FROM the Client Script's controller.
  3. options - The options used to invoke the widget on the server.

APIs Available

  1. Classes
    1. GlideSPScriptable - Methods for use in Service Portal widget Server Scripts. Use the global $sp object.
    2. GlideSystem - ?
      1. gs.error()
      2. gs.addErrorMessage()
    3. getWidget() - Gets a widget by id or sys_id, runs the widget's server script using the provided options, then returns the widget model.

- Tips

  1. Many developers use third-party debugging tools when debugging browser-based applications, for example: NG Inspector Chrome Extension
  2. One useful Client-Side debugging technique is to output an object to the HTML by adding an actual HTML tag as follows: <pre>json</pre>

- Important - Hidden Feature: You can use Ctrl + Right Click on a widget in the preview pane to get to the speed menu for the widget, and access options such as “Log to console: $scope.data”.

- Example

  1. Portal Page
    1. Dragged and Dropped both widgets onto the page.
  1. Notes List Widget
    1. Server Script

2)

  1. Declare an array called “notes”.
  2. Use GlideRecord to query the database with the current user as a parameter.
  3. Populate the array.
  4. Apparently ANY array declared in this script block will make it back to the client as a part of the $scope object (scope.data.notes).
  1. Client Script

5)

  1. Declare a function which will be executed when an item is clicked. (Corresponding function name appears in the HTML.)
  2. This function will “emit” an event.
    1. c.selectedItem = function(idx) {

				$rootScope.noteID = id;
				$rootScope.$emit('selectNote', id);	}
  1. HTML

1)

		Define some static HTML for the List Widget, just so it shows up.
		<Div>
		<H3>
			${Notes}	- Believe this serves as both the text "Notes" and an object.
		<P>
		Plain Text
		3)

Refine the HTML for the List Widget. Use a List Group and List Group Item, along with “ng-repeat” to iterate through the “data” object, and access the data records in the “notes” array, supplied by the Server Script. Use magical syntax to access individual properties. <div class=“list-group”> <a class=“list-group-item” ng-repeat=“note in data.notes” ng-click=“c.selectItem($index)”> <h4 class=“list-group-item-heading”> note.title </h4>

		4)
		Declare a function to execute, using "ng-click".

<a class=“list-group-item” ng-repeat=“note in data.notes” ng-click=“c.selectItem($index)”>

  1. Notes Body Widget
    1. Client Script

6) Declare an event handler to respond to the “selectNote” event. $rootScope.$on('selectNote', function(event,data) { jslog('Listener caught NoteID: ' + $rootScope.noteID); });

		7)
		Make a call to the sever using c.server.get().
		Respond to the server call using an asynchronous callback function, named "r".
		c.server.get({
			action: 'getNote',
			noteID: $rootScope.noteID
		}).then(function(r) {
			c.data.title = r.data.note.title;
			c.data.note = r.data.note.note;
			c.data.noteID = r.data.note.sys_id;
  1. Server Script

8)

		Get fresh data from the database.
		The "input" object is the "data" object received from the client script's controller.

(function() {

			/* populate the 'data' object */
			if (input && input.noteID) ...
				$sp.getRecordValues(data.note, note, "title, note, sys_id");
  1. HTML

9) Use the AngularJS directive “ng-show” to show/hide the widget contents based on whether c.data.NodeID has a value. <div class=“panel panel-default” ng-show=“c.data.noteID”>

...

<input class=“form-control” id=“note-title” ng-model=“c.data.title”/> 10) Add the ng-change directive to the HTML elements so the widget can respond to changes. <input class=“form-control” id=“note-title” ng-model=“c.data.title” ng-change=“c.updateNote('title')” ng-model-options=“{debounce: 1000}”/>

Widget Macros - Syntax Editor Macros

To get syntax editor macros to work in widget editor…

filter navigator>service portal>Service Portal Configuration

crate new widget 'macrotest' submit

in the serverScript section, type vargr and tab.. nothing happens. to get this to work, do the following;

filter navigator>ui scripts

import xml file 'UI Script to Enable Syntax Editor Macros.xml'

'right click on the list header and select import xml choose the file, Upload

imported a ui script called wigetmacros

now navigate to >service portal>widgets open 'widget edit panel' by filtering name

scroll to the bottom.. under dependencies select new name widgetMacros DONT SUBMIT.. click save…to stay on page

Now under JS Includes.. select NEW

Display name 'widgetMacros' source=ui script find the wigetMacros script and click submit…

go back to the widget editor… open the widgetMacros widget.. go to the server Script section and try vargr and tab.. see if it is working…

https://instance.service-now.com/sp_config?id=page_edit&p=sc_cat_item&table=sp_instance&sys_id=f4b3b2c15b3212000d7ec7ad31f91a4f

https://instance.service-now.com/sp_config?id=lf&table=sys_update_version&relationship_id=REL:67bdac52374010008687ddb1967334ee&apply_to=sp_widget&apply_to_sys_id=0fb269305b3212000d7ec7ad31f91ae2&sys_id=1807eae41bb1211099e265b1604bcb00&spa=1

https://instance.service-now.com/sp_config?id=widget_editor&sys_id=6f85dbad97a70110c8d83a4e6253af55&spa=1

https://instance.service-now.com/sys_properties.do?sys_id=c34cd1fac6112282005cb0bb9ead2316&sysparm_record_target=sys_properties&sysparm_record_row=2&sysparm_record_rows=2&sysparm_record_list=nameCONTAINSglide.product.name%5EORDERBYname

https://instance.service-now.com/nav_to.do?uri=%2Fsp_page_list.do%3Fsysparm_nostack%3Dtrue%26sysparm_query%3Ddynamic_title_structureISNOTEMPTY%26sysparm_first_row%3D1%26sysparm_view%3D


WIKI Articles

If you need to get to an article on the old ServiceNow WIKI site:

http://wiki.servicenow.com/

You can go to this archive of the site:

https://web.archive.org/web/20170821025212if_/http:/wiki.servicenow.com/

So, if you replace the one with the other, and then attach the rest of the URL, you should be able to find articles. - Example:

http://wiki.servicenow.com/index.php?title=GlideRecord#setWorkflow&gsc.tab=0
https://web.archive.org/web/20170821025212if_/http://wiki.servicenow.com/index.php?title=GlideRecord#setWorkflow&gsc.tab=0

Workflows

- Modules Workflow - Workflow Editor Workflow - Active Contexts Workflow - Active Contexts - [My Context] - Workflow Log Workflow - Being phased out and replaced by the “Flows” concept. - A complex, non-linear set of activities, that provides contingencies and notifications, used to automate a multi-step process. - Workflow creation is a complex task. - The apps delivered by ServiceNow are divided into 3 different workflows: IT, Employee, and Customer. - Underlying Workflows automate Approvals and route requests through Fulfillment Stages. - To create a new Workflow, you can copy an existing one, or you can start from scratch. - A workflow has a name, and is tied to a particular table. Fields from this table, and related tables will be available to the activities in the workflow. - A workflow may be triggered by the setting of a field value on a record, by a UI Action, or by Server-Side script. - The workflow has a special variable called the “Stage”, which helps with routing and branching. - Workflows do not need to be saved. All changes are written directly to the database. - The Validation Button (checkmark) checks for things like Missing transitions, Missing (or multiple) End activities, or invalid table references. - Context:

  1. A workflow's runtime environment. The Context “knows” which record the workflow was launched for.
  2. Viewed via Workflow - Active Contexts.
  3. The “Related Record” field contains the number of the record the workflow is actually for.

- Contains a related list called “Workflow Log”. Messages are written here as a part of normal workflow execution. The Log Message workflow Activity can be used to explicitly log messages to the workflow log. - In scripts a developer can use the following functions to log messages to a special log that only shows up in the Workflow Context: workflow.info workflow.warn workflow.error workflow.debug - Note: If no approvers are found for a workflow approval activity, the activity defaults to Approved! - Activities - From the “Core” tab, you can drop an “Activity” onto one of the Transition lines. - You may also Double Click an Activity on the Core tab, but if you do so, you must manually connect Transitions later. - You may also right click a Transition, and choose “Add Core Activity”. - Common workflow “Activities” include: - Approvals - “Catalog Task” - Notifications (Email) - Run Script - “Set Values” (on a record) - Tasks - Test a Condition (Branch) - Scope - Workflows have a concept of Scope. The workflow editor takes its scope from the window or tab that launched the editor. Activity configuration fields are read-only for out-of-scope workflows. You cannot see the scope in the Workflow Editor. You need to be aware of your scope when you launch the Workflow Editor. If you have the application picker on the banner, you can easily see what the scope is when you launch the Workflow Editor. If you do not have the application picker on the banner, then you would need to open the settings and view the Developer tab to see what scope the main ServiceNow window is in. If you open Workflow Editor from Studio, Workflow Editor opens in the scope of the application you have open. - States - Checked Out - Will execute only for the user who has the workflow checked out. - Unpublished - No longer available for new contexts (new executions), but may still be running for older contexts. - Published - Will execute for all users and records meeting the workflow conditions. (Publish after development and testing are complete.) - Transitions - To add a Transition, click down on a node, then drag the mouse to an Activity, then release the mouse button. - You connect workflow activities, after you have added them to the designer canvas, with “Transitions”; Drag the mouse form the workflow Stage (bottom part of each tile) of one activity to another activity, in order to make these connections. - The workflow context contains a related list (tab) called Workflow Log in which some messages are written as a part of the normal workflow execution. - The “Log Message” Activity may be used to write informational messages to the Workflow Log.


Workspaces

- A ServiceNow Workspace is a suite of tools. It is a new user interface that puts on ONE SCREEN all the tools needed to find, research, and resolve an issue. A Workspace is a single-pane view that a tier 1 agent may use to respond to all task types, view the full context of an issue, and get relevant recommendations to resolve an issue. With Workspace, an agent can have multiple issues open at the same time in a tabbed format. An Agent can quickly move between issues without going to different screens. - There are multiple workspaces in ServiceNow, for example:

Agent Workspace for Request Management  - Integrates the platform functionality specific to tier 1 agents in an easy-to-navigate interface.
ITSM Agent Workspace - Used to resolve IT Issues.  (ITIL Role Required)
Customer Service Management Workspace - Sending a piece of hardware to fulfil an external customer request.

- May be customized by a system administrator. - Workspaces are found, in ServiceNow, via the filter navigator, under “Workspaces”. - Form any “List View”, when you click on a specific record, it is opened in a new tab called a “Record View”. - Record View

  1. On this view, there is a “Ribbon” which may be configured to show different “Widgets”, such as a Customer Details widget or SLA widget.
    1. Important: The ribbon may be collapsed to give you more working space.

- There are “Panes” such as Form, Activity, and Agent Assist - You can always get back to the main Agent Workspace “Landing Page” by clicking on the Home icon at the top left. The homepage contains basic scorecards and reports. - As with the regular Form View, there are tabs for Relates Lists. They just are displayed a little differently. - Agent Assist - The Agent Assist pane is initially populated with the Short Description of the ticket you are working on. But the search query may be changed to anything. Agent Assist is supposed to help the agent identify common solutions to known problems. - Agent Intelligence searches for common resolutions and problems that match the open ticket. Claims to involve some AI. - Agent Assist displays Catalog Items and allows you to attach additional information to a ticket without leaving the workspace. - Agent Assist Display Condition has been moved to Declarative Action Assignments??? - Filter Navigator - Workspace Experience - Contextual Side Panel - Table: sys_declarative_action_assignment

Table = Incident
	Set View to "Advanced" to see Conditions tab.

- ServiceNow Docs - Workspace

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/workspace/concept/service-workspace.html 

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/workspace/concept/learn-about-agent-workspace.html - There are “Premium Landing Page” plugins which may be installed.

- To get the display text (displayValue) of a form's reference field, you apparently need to use the undocumented getDisplayBox() method, as follows:

var sTheDisplayValue = g_form.getDisplayBox('approver').value;
alert("sTheDisplayValue: " + sTheDisplayValue);

- If you need a synchronous (blocking) call to the server, you can use getXMLWait… in the context of a Form (but not the portal), as follows: ga.getXMLWait(); sTheAnswer = ga.getAnswer(); alert(“sTheAnswer: ” + sTheAnswer); In the context of the Portal, you will need to jump through some extra hoops, as described here: https://community.servicenow.com/community?id=community_article&sys_id=e37f2072db9fd0103daa1ea6689619c6

- Include In Update Set Tool https://snprotips.com/include-in-update-set-tool

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0520375

- Orphaned Records Issue

  1. This is the issue where a record appears in a list view, but when you click on it to open it in form view, you get “record not found”.

- Sometimes when you are in a list view such as sso_properties.list, and you click on a particular record, what actually happens is that the record is opened against a child table of sso_properties, such as saml2_update1_properties. - Use the table sys_db_object to understand parent / child table relationships. - If a record becomes orphaned, you can do the following:

  1. Export XML (from list view, of just that ONE record you are having trouble with).

- Change table name to the name of the parent table such as sso_properties. Change both the opening and closing tags. - Change action to DELETE - Keep sys_id field. All other lines may be deleted from the XML file. - Import the XML file to execute the delete operation.

Web Services Security (WS)

- https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/security/concept/c_WSSecurity.html - Support for WS-Security 1.1 in the form of WSS X.509 Token Profile and WSS Username Token Profile is available for incoming SOAP requests. - The configuration to use WS-Security is separate from the requirement to enforce Basic Authentication, and is enforced when the SOAP envelope contains the WS-Security headers. - X.509 - An X.509 certificate specifies a binding between a public key and a set of attributes that includes (at least) a subject name, issuer name, serial number, and validity interval. An X.509 certificate is used to validate a public key that is used to sign the incoming SOAP message. Upload the certificate in the Certificate module and reference it in the X509 Certificate field. If this is a bound session, select the user to impersonate when the WS-Security authentication succeeds. - Manual Authentication - https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/security/concept/c_MutualAuthentication.html

  1. Establishes trust by exchanging Secure Sockets Layer (SSL) certificates.

- Before connecting to a server, the client requests an SSL certificate. The server responds by requesting that the client send its own certificate. Both respond by validating the certificates and sending acknowledgments before initiating an HTTPS connection.

To remove a Widget from an Agent Workspace portal page

Ctrl + Right Click Widget This will show you the name of the widget in the first row of the popup menu. Page in Designer - Then click Page gear icon at the top right. This will show you the name of your sp_page. For example: sw_sc_cat_item / Catalog Item. Service Portal - Pages - sw_sc_cat_item

Containters / sp_container
	Rows / sp_row
		Columns / sp_column (You can deactivate widgets here.)
			Instance / sp_instance (You can also deactivate widgets here.)

- There may be a much easier way to do this, but I don't know what it is.

To find an Application NAME from an Application Scope (namespace), use the “sys_scope” table and add the Scope column.

Example:
	Name						Scope
	Service Catalog - Service Workspace		sn_sc_workspace

- Background scripts are apparently allowed to run for longer than scheduled script execution scripts which are marked as On Demand.

Workflow Stages

Tables wf_stage

  1. Allows workflow-specific stages to be defined.
  2. This is also a Related List accessible via the Workflow Editor when you click on the I icon for Workflow Properties.

wf_stage_default

Allows stages to be defined at the table level.

https://community.servicenow.com/community?id=community_blog&sys_id=bbddaae9dbd0dbc01dcaf3231f96194c https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/administer/using-workflows/concept/c_WorkflowStages.html https://community.servicenow.com/community?id=community_question&sys_id=92e883a1db5cdbc01dcaf3231f96195e https://community.servicenow.com/community?id=community_question&sys_id=8c4069dbdbcde01011762183ca961995&feedbacktype=topRatedAnswerHelpful https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/administer/using-workflows/concept/c_WorkflowStageSets.html#c_WorkflowStageSets - Workflows can provide a summary of workflow progress by updating any field you specify, of type “Workflow”. - Any field may be designated as a “Stage Field”. - For example

	Incident Record - Stage Field may be designated as "Incident State"
	Requested Item - Table sc_req_item - Stage field may be designated as "Stage".

- For workflows that use the Requested Item table, the stage field is automatically set and cannot be changed.

  1. Use the Workflow Properties to specify the Stage field.
    1. If the field specified is a Choice List, then the choices are available as stage values for the workflow.
    2. If the field is a Workflow field, it displays an icon to indicate the workflow's progress.

- After stages are added to the workflow, they can be assigned to each workflow activity. If an activity with an assigned stage is encountered when the workflow runs, the workflow engine assigns the stage.

  1. Activities

- If an activity is active, then the stage is shown with the state of In progress. - If an activity is in the Pending or Completed state, the stage reflects this state. - If an activity is canceled, Request Cancelled appears in the Stage field.

  1. Form Behavior

In a form, the workflow field displays the current stage as a choice list value.

  1. List View Behavior

- If the stage field for a workflow is the table column named Stage, the progress of the workflow appears in any list view containing the Stage column. - Stage values shown in the list views are accompanied by the state, based on the workflow activities being executed. If an activity has a stage specified for it, and the activity is currently active in the workflow, then the stage is shown with a state of In progress. Similarly, if the activity is in the Pending or Completed state, the stage reflects this state. - Request Item States

  1. From sc_req_item.stage choice list…

Waiting for Approval

	Fulfillment
	Delivery
- From wf_stage_default…
	Request Cancelled
	Completed
- Custom values set by the administrator in the workflow editor via table wf_stage…
	Start
	Abort

- Incident States

  1. OOTB Incident States are:

Pending An action is pending to be taken; dependency from another team, or requires additional information from user.

	Resolved			Ticket can be re-opened if solution is insufficient.
	In Progress			Have understood the issue & it is being worked accordingly.
	Closed				Solution provided is fine thus can be closed. OOB functionality closes ticket after 7 days from Resolved state.

- Project States - OOTB Project States are:

	Project State			Category

Pending Active Open Active Work in Progress Active Closed Complete Closed Closed Incomplete Closed Closed Skipped Closed - When you first create a Project the Project state will be Pending. What Pending means is determined by your organization; it could be “no prep work has begun”. ServiceNow does not define a Project State of Open either; it could be “prep work has begun but the project has not officially begun”. I find some clients skip both and go directly to Work in Progress, especially if they are converting Demands to Projects. But you define the definition of both Pending and Open States of a Project. - When a project is created it is in Pending state. When you click on “Start Project”, the state automatically changes to “Work in Progress”. This impacts the state of tasks set to Start ASAP. - If you change the state of any ONE Project Task, the parent Project State will change as well - based on the 'most active' state (Pending > Open > Work in Progress). For example, if the parent Project State is Pending, and you change at least one Project Task State to Open, the Parent Project State will change to Open. If the parent Project State is Pending, and you change one Project Task State to Work in Progress, the Parent Project State will change to Work in Progress. - There is no “On Hold” state. I get you may want this. I usually add an “On Hold” checkbox to all Project forms to help with reporting so I don't mess with the States (see bullet two above). But there is no “On Hold” functionality. - If you change the Project State to one of the Closed States all Project Tasks will be closed as well. - It is best practice to make changes to the Project State via Project Task States and let the magic occur in the background. But if you have no Project Tasks you will need to make changes within the Project State field. - Duration - If you want to report on how long the item spent in each stage, an easy way would be to create a field duration Metric for this on the stage field. https://docs.servicenow.com/bundle/sandiego-platform-administration/page/use/reporting/task/create-metric.html - When you create a new Workflow, you specify the Stage behavior on the Stages tab, or subsequently on the Workflow Properties - Stages tab.








Webhooks

- A User-Defined HTTP callback to an external system. - A way to feed information from your application to an external system based on some event or action.

w.txt · Last modified: 06/02/2023 05:01 by johnsonjohn