LogiUpSkill

Application Menu and Module in Service-now

Application Menu and Module in Service-now Tables in ServiceNow, Create Users : sys_user (Table ) Create Roles : sys_user_role (Table ) Assign a role to user : sys_user_has_role (Mapping Table (User – Role) ) Create Group : sys_user_group (Table ) Add user in a Group : sys_user_grmember ( Mapping Table) Assign a Role to Group : sys_group_has_role (Mapping Table) Add one Role into another Role : sys_user_role_contains (Mapping Table) In ServiceNow, Survey – User Groups User Administration – User Roles Table having mapping of user and role You can find Group Role by writing Group Role in Navigation Panel as below, Get a list of group members by writing sys_user_grmember.list in navigation panel as below, If you write sys_user.list in Navigation filter , and Enter, You will find a list of all users. List Of Users : We can find a table name by 2 ways Configure table 2. Table name can find in URL , What is context menu? Application Menu : To Create Application Menu , Go To Application Menu in Navigation panel as shown in the picture below. To Create new application, Click on New Button ,as shown in below picture      While creating an Application,if Role is not assigned it means everyone can access this application. (Refer above figure) Application can be said as a container of modules. Every application contains Modules. Module : Modules are used to access the functionality of ServiceNow,these functionalities are dependent on tables. To create Modules ,search Module in Navigation Panel. Click on New Button to create new Module, as shown in above picture Write Module Name and Application Name under which we want to add Module, as shown in below picture,. E.g Module Name as Contains Role Module,       Application Name : LTI Training Instead of writing Application Name directly,You can select it from the list by clicking on the search button in Application Menu option. Visibility Tab : Override application menu roles : Allows users to access this module even if they do not have permission to view the containing application menu. Users must still meet the role requirements for this module. Link Type : Link type field specifies what type of link the module opens. We can find a lot of link types,as shown in the picture below. Table : Number of table can be seen under Table, For now, Take table name as sys_user_role_contains  and click on Submit,as shown in the picture below. So now,if you search LTI Training in a navigator filter, you can see it with the module which we have added previously. (See Below Picture ) If you click on that module you will see all the contained role list. We can Edit Application by clicking on Pencil near Application name as shown in below picture. we can find related modules at the bottom of the form. (See the picture below) In above Picture, If you click on New Button near Modules,a new form will be generated for new module and Application Name will be automatically displayed. Write Module Name,Link Type and Table name and Click on Submit button,as shown in above picture. Link Type URL example : See below picture for URL link type example.(_blank is used to open that link in new window) Note : If you assign any role to user then that user need to logout and login again to get that access. You can give an order to a module ,Double click below Order for the required module.( as shown in above picture,) Link Types Explanation : Link type field on the Module form specifies what type of link the module opens. Assessment Links to the assessment-based survey you select in the Assessment reference field. Content Page Displays the content page you select in the Content page reference field. Documentation Link Links to a documentation page and opens in a new tab or window. This link type is used with embedded metadata in documentation topics. To open an internal document from a module, use the URL (from Arguments) module link type. Homepage Displays the homepage you select in the Homepage reference field. HTML (from Arguments) Places HTML in the application navigator. This link type is used for more complicated links, where a flat URL is not customizable enough. Note: The HTML (from Arguments) link type is supported in UI15 and UI11 only. In UI16, use the URL (from Arguments) link type instead. Enter a value for the Arguments field. List Filter Displays an unpopulated list view for the table you select in the Table field. Allows users to specify a filter without loading the list first. Use the Filter field to define the default filter for the list. Use the View name field to specify a  List of Records Displays the list view for the table you select in the Table field. Use the Filter field to define the default filter for the list. Use the View name field to specify a view. Map Page Displays the map page you select in the Map page reference field. New Record Displays a form for creating a record in the table you select in the Table field. Use the View name field to specify a view. Use the Arguments field to apply a template. Run a Report Runs the saved report you select in the Report field. Script (from Arguments) Runs a script, as defined in the Arguments field. Note: Enter a value for the Arguments field. Search Screen Link that displays a blank form for searching records in the table. Use the View name field to specify a view. Note: Use the parameter &sysparm_result_view=view_name to define the view the results are rendered in. Note: All searches use a [starts with] query to search for matching text. Other query types are not supported in search screens. Separator Creates a division between modules. Enter a name in the Title field to add a section name that users can collapse or expand. Single Record Displays a form for a single record on the table. Use the

Concept of Inheritance in Service-now

Concept of Inheritance in Service-now Assignment 1- Concept of Inheritance in tables Parent_table Child_table 1 Child_table 2 While creating Parent_table, check the box : Enable extension under control section in the create table window.              Create fields in Parent_table as: P_first_name P_last_name P_phone_no  Create Child_table 1 by extending Parent_table as shown in the screenshot below.              In Child_table 1, create fields as: C1_first_name C1_last_name C1_phone_no Similarly create table Child_table2 extending Parent_table.  While creating fields in both Child_table 1 and Child_Table 2, it is seen that fields present in Parent_table is present in the 2 child tables. So the fields created in parent table reflects across all it’s child tables.  In Child_table2,create fields as: C2_first_name C2_last_name C2_phone_no Now , the relationship is created in such a way that Parent_table is the parent of both Child_table 1 and Child_table 2. This can be verified by searching for the parent table in the navigation bar Then click on Show Schema Map. The Schema for Parent_table is shown below: Create new records in all 3 tables and observe the records that are reflected between parent/child table.  Step1: In the above2 screenshots, we can see that  records added in Parent table are not seen in the Child_table 1 .The same is true with Child_table 2 also. Step 2:  A new record in Child_table 1 is created in the above screenshot.  When the Parent_table is checked, it is seen that the record created in Child_Table 1 is visible. So the data/ records in child table is reflected in parent table as well.  Step 3:  A new Record is created in Child_table2  It is observed that the new record from Child_table 2 is visible in Parent_table also.   It is finally seen that the fields are reflected from parent to child table, but the data/records are not. Also the data/records created in child table reflect in parent table but not the fields alone In summary, Fields/customization flows downwards and data/records flow upwards in Parent-Child Relationship. Concept of Inheritance in tables  When inheritance is established between two tables, the customization flows from parent table to the child table but the records/data flows from the child table to the parent table. Example: If two tables A and B are created such that B is a child of table A, then the fields created in table A are reflected in table B but records created in table A are not reflected in B.On the other hand, the records created in table B are reflected in it’s parent Table (A) but not the fields. While creating a UI Policy for a particular table, the same UI policy can be applied to it’s child table as well. This can be done by checking the ‘inherit’ checkbox while creating the UI Policy for that table.

Custom Scoped Application

Custom Scoped Application Application scoping protects applications by identifying and restricting access to application files and data. Another way click on CREATE NEW TABLE We can create new table which is extended from task If we select from list we can create the table from here Another way click on CREATE NEW TABLE Table Goto scope=list view Goto Data model ⇒ table  Configure related list Since table extended from task so it is always we need to edit in GLOBAL scope Open field  See field  Goto file⇒ create file  See my table and other table  create=from which table you want this form  After create ⇒ see form design We know 2 config a.form design and b.form layout  Do changes Cross check  See form we designed  ********************************************************************************** We can create module Create new See able to create module in global scope able to create module in global scope because of application access =All application scope Now GOTO è module  work_assignment è Configureè Table see Now change to this application scope Changed scope to global Open application Create module See no matches found Create script include in Global application Check in Background script o/p Script include with same scope Check in Background script-same scope o/p Check in global scope o/p Open application See From here we can publish in update set   Scoped application caller tracking and restricted   caller tracking –After calling script then get access, it will track data caller restricted- After calling script then restricted Application -work_assignment ,caller restricted Associable from=all application scope SCRIPT INCLUDE created in work_assignment and now we are write background script on Advanced work_assignment Function is caller restricted o/p To remove restricted access Goto =application  Application administration = true Related sec Now check in advanced work_assignment scope o/p 2nd script include Application -work_assignment ,caller tracking   Associable from=all application scope Scope is advanced work_assignment in background script o/p See the sys_scope_privilege.LIST Custom Application Form fields Custom Application Form fields Field name Type Description Name String The display field for the package Version String Identifies the latest version of the package in dot decimal notation Scope String Read only Identifies unique application scope [x_companyCode_shortAppID] See properties Glide.appcreator.company.code Application administration Boolean When checked system administration will be preventing from accessing the application Can Edit Application in Studio Boolean Allow user to edit application file in studio Run time access tracking Choice a. Tracking log-access the system and allows script to execute b.Enforcing log – access the request but required administration authorization before script executation proceed Script interaction with other application is controlled by the system runtime access system Use Runtime Access Tracking to manage script access to resources from other applications Restrict Table Choices Boolean Restrict design time access to table outside application scope Licensable Boolean Licensable or not Subscription requirement Choice a.Monitor b.Required Subscription requirement for usage of this package Subscription model Choices a.NA b.fulfiller /requestor c.procedure d.capacity e.mixed f.Application in use  Subscription model is defined here Subscription Reference Refer to license_details Menu Reference Refer to sys_app_application This application primary menu where default table module will reside User role Reference Refer to  sys_user_role Role required for end user to access this application and its table Short description string Short description for application logo User_image Logo for application Guided Setup Reference Refer to   gsw_content Guided Setup to start when to application is installed/upgraded                                                                                             Related links Manage Collaborators Collaboration descriptors let you assign, manage, and monitor permissions for each application or across multiple applications consistently Collaborators -a person who works together with others for a special purpose O/P Related link -click on manage collaborator See See user can do following thing Move restricted to tracking It will simply just move Whatever configuration we have done on custom scoped application restricted to tracking  Move tracking to restricted It will simply just move Whatever configuration we have done on custom scoped application tracking to restricted View License Definitions It will redirect to sys_app_license_defn_list Publish to Update Set Publishes all the code from an app to a newly created updated set that can be used to transfer the  app between instance Grant app administration to all admins Grand a role that are required for the admins to be able to grand any of the applications role Enable Session Debug 8.Scan Application 9.Convert to Application Repository Mode   When your applications are placed in the Custom Applications table [sys_app], you can’t upgrade them directly through the Application Repository. This procedure helps you do a one-time conversion when you want to migrate deploying your applications using the Application Repository. After you convert the application, it is no longer enabled for development on the instance where the conversion is performed. For a scoped custom application, all associated records in the Customer Updates table are deleted for this application. After this see application Resync Collaboration Permissions Refresh delegated development permission for collaborators

Journal

How to remove the comment or work note from activity in Servicenow How to remove the comment or work notes from activity in Servicenow. Lets go from basic i.e. comment and work notes are Journal Input type of field in servicenow. Journal field type in Service-now 1.journal         – Stored the data and can show all the data at once in form and list view. 2.journal_input   – Stored the data and can not show all the data at once in form and list view. 3.journal_list    – Used to display the data Delimiter in Journal entires  “nn” Properties regarding Journal Entries 1.glide.history.max_entries  –  Max number of journal entries included in activity. 2.glide.email.journal.lines  – Max number of journal entries included in email notification.  Important tables regarding Journal Fields: 1.sys_journal_field – stored all the journal field type field values 2.sys_history_line –  Stores the all audited field changes How to remove the comment or work notes from activity. 1. For example we need to remove the below hightligheted additional comment from incident. 2. So this entry was stored in 2 tables.     2.1 sys_journal_field – stored all the journal field type field values     2.2 sys_history_line –  Stores the all audited field changes 3. First one is sys_journal_field – where all the jeneral fields value get stored  and we need to find the record with filter condition like      3.1 value contains the value in additional comment     3.2 Element id will be a sys_id or record     3.3 table will be a table name Please refer the below screen shot for reference.     Delete the selected record from sys_journal_field. 4. but still you can see the additional comment on the incident form because we still need to remove the comment entry from table “sys_history_line” 5.”sys_history_line” table stored the history of audited fields.    5.1 set = “sys_id of incident record” –     5.2 field contains “comments”    5.3 Here you can search using Username column name as well. Please refer the below screen shot for reference.    Delete the selected record from sys_history_line.   6.After deleting the above two entries,the additional comment will get removed from the system or activity.

ACL

ACL in Service-now Access Control List (ACL)  What is ACL? ACL is a list which allows the users to have different access like create, write, read, delete and etc to particulartable of the fields of table. Users with specified roles can only access the given operations like create, write, delete, read, execute. Scripts are used on the bases of condition for true and false. Only those users can give access to another users who have security administrator privilege. These are some operations used in ACL Create: – This operation enables user to create a new record in the table. Write:- This operation enables user to edit the existing record in the table Read: – This operation enables user to read the records in the table but not to edit. Delete: -This operation enables user to remove the existing records from the table. Execute:- This operation enables user to run the scripts on record or UI policies.  Types of ACL Record ACL              In Record ACL we need to satisfy the Field ACL and Table ACL. In this if ACL is applied to parent table then the ACL will             be automatically applied on the child table. Field ACL              In Field ACL we apply ACL to particular Fields so that the only those fields will be visible to the user. To make all fields visible             we need to select (*). Table ACL              In Table ACL we apply ACL on table so that the whole table will be visible to the user. Only the table will be visible but not the             records. Records will be visible if field ACL is also applied. To make whole table visible we need to select (*).   How to Create an ACL?  Example : – Create an ACL where following Conditions should meet. If state=In Progress then only ITIL role users can edit the state field. If state=Resolved then only Admin role users can edit the state fields. If state=closed and “current user” and the “User Name” are same then only user can edit the state field. If state=new, anyone can edit the field. If state=closed, all the fields for all the user should see as read-only.  Procedure to create ACL   I have created the table called User ACL now I am going to apply the ACL to this table. The first thing which you need to do is elevate the system_admin role. Then go to Navigation Bar and click ACL and select Access Control Once you reach to the above show page you will find that each table will be having inbuilt ACLs. If you want to makechanges on any particular table you can edit in the existing ACL itself by adding a role and writing the script for thatparticular operation. I have created a new ACL for this condition and written a code also and the condition is if stateis closed then all fields should be read-only to the users. The condition is if state is closed and the current user and username are same then only user can edit. For this conditionI have applied ACL to the state field and written code and in condition field I have given if state is closed so that it willwork when state is in closed. The condition is if the state is new anyone can edit this so I have written a ACL for only state field and given conditionas the state is new. The Condition is if the state is resolved only admin can edit it so I have created an ACL for edit the state field only withthe condition state is resolved. The condition is if the state is in progress then only ITIL user should edit it. So I have created an ACL with edit to thestate field only and given role as ITIL and condition as State is in progress. Created one additional ACL for read and write for the whole table without any user.   Output If state=In Progress then only ITIL role users can edit the state field. If state=Resolved then only Admin role users can edit the state fields. If state=closed and “current user” and the “User Name” are same then only user can edit the state field. If state=new, anyone can edit the field. If state=closed, all the fields for all the user should see as read-only. ACL Assignment Create a Table with one Auto number field.Create 2 sting field i.e. first name and last nameCreate State field with following values      1.New     2.In Progress     3.Resolved     4.Closed Create one reference field if user as User Name Requirements:      1. if state=In Progress then only ITIL role user’s can edit the state field.      2. if state=Resolved then only Admin role user’s can edit the state fields.      3. if state=closed and “current user” and the “User Name” are same then only user can edit the state field.      4. if state=new, any one can edit the field.      5. if state=closed, all the fields for all the user should see as readonly. (except the req 3)

Practice Examples in Service-now

Practice Examples in Service-now Practice Examples from Shala Master Scenario1:-Cancel the incident form submission if user has typed “Credit Card” in short description.(User OnSubmit Client Script) function onSubmit() {    //Type appropriate comment here, and begin script below     var desc = g_form.getValue(‘short_description’).indexOf(“Credit Card”) > -1;     if ((desc == true)) {                         alert(“Please remove the word ‘Credit Card’ from your short description to Submit the form”);                         return false; }      } Scenario2:-User should not insert or update the incident record if user has entered “password” inwork notes or comments. (function executeRule(current, previous /*null when async*/) {             // Add your code here             var worknote = current.work_notes.getJournalEntry(1);     var worknoteContent = worknote.split(“(Work notes)n”);     var lastWorknote = worknoteContent[1];     var comment = current.comments.getJournalEntry(1);     var commentContent = comment.split(“(Additional comments)n”);     var lastComment = commentContent[1];             if(lastWorknote.indexOf(“password”)>-1){                         current.setAbortAction(true);             }             if(lastComment.indexOf(“password”)>-1){                         current.setAbortAction(true);             } })(current, previous); Scenario3:-Show AddINFO message “Caller and Assigned to are same” if caller and assinged tousers are same. (function executeRule(current, previous /*null when async*/ ) {     // Add your code here     if (current.assigned_to.name == current.caller_id.name) {         gs.addInfoMessage(“The caller and assigned to should not be same”);     } })(current, previous); Scenario4:-Show alert “Manager are same for Caller and Assinged to User” if the caller’s managerand assigned to user’s manager are same for incident. function onSubmit() {     //Type appropriate comment here, and begin script below     var cman = g_form.getReference(“caller_id”).manager;     var aman = g_form.getReference(“assigned_to”).manager;     if (cman == aman) {         alert(“Manager are same for caller and assigned to user”);     } } Scenario 5:-User should not select a user for assinged to field for incident record if user does nothave email id. function onChange(control, oldValue, newValue, isLoading, isTemplate) {     if (isLoading || newValue === ”) {         return;     }     var email = g_form.getReference(“assigned_to”).email;     if (email == “”) {         alert(“You cannot select user that does not have an email id”);                                 g_form.clearValue(“assigned_to”);     }     //Type appropriate comment here, and begin script below } Scenario6:-Make state readonly if loggedin user and caller are same on incident form. function onChange(control, oldValue, newValue, isLoading, isTemplate) {     if (isLoading || newValue === ”) {         return;     }     var user = g_user.firstName + ” ” + g_user.lastName;     var caller = g_form.getReference(“caller_id”).name;     if (user == caller) {         g_form.setReadOnly(“state”, true);     }     //Type appropriate comment here, and begin script below } Scenario7:-Make state readonly if state=New on incident form. Using UI Policy Scenario8:-Set Assinged to= Pavan if category=Network. function onChange(control, oldValue, newValue, isLoading, isTemplate) {     if (isLoading || newValue === ”) {         return;     }     if (newValue==”network”) {        g_form.setValue(“assigned_to”,”Pavan”);     }     //Type appropriate comment here, and begin script below } Scenario 9:-Show alert if the state changed from Resolved to In Progress. function onChange(control, oldValue, newValue, isLoading, isTemplate) {     if (isLoading || newValue === ”) {         return;     }     if (oldValue == 6 && newValue == 2) {         alert(“The state has now changed from Resolved to In Progress.”);     }     //Type appropriate comment here, and begin script below } Scenario10:-Whenever caller changed the comment field for incident set state=In Porogress. function onChange(control, oldValue, newValue, isLoading, isTemplate) {     if (isLoading || newValue === ”) {         return;     }     var user = (g_user.firstName);     var caller = g_form.getReference(“caller_id”).first_name;     if (user == caller) {         g_form.setValue(“state”,2);     }     //Type appropriate comment here, and begin script below } Scenario 11:User should not change the state from Resolved to In Progress without putting commenton incident form. function onChange(control, oldValue, newValue, isLoading, isTemplate) {     if (isLoading || newValue === ”) {         return;     }     if (oldValue != 6 ;& newValue != 2)         return;     g_form.setMandatory(‘comments’, true); } Scenario 12:-  Show Comment and worknote value in AddINFO message after insert or update ofincident record. (function executeRule(current, previous /*null when async*/ ) {     // Add your code here     var worknote = current.work_notes.getJournalEntry(1);     var worknoteContent = worknote.split(“(Work notes)n”);     var lastWorknote = worknoteContent[1];     var comment = current.comments.getJournalEntry(1);     var commentContent = comment.split(“(Additional comments)n”);     var lastComment = commentContent[1];     gs.addInfoMessage(“The additional comments are: ” + lastComment + ” <br/><br/>The Work Notes are: ” + lastWorknote); })(current, previous); Scenario13:-Caller user should not have access to Assignment group and Assigned to field onincident form. If user is caller is logged in user he will have assignment group and assigned to as read only function onChange(control, oldValue, newValue, isLoading, isTemplate) {     if (isLoading || newValue === ”) {         return;     }     var user = (g_user.firstName);     var caller = g_form.getReference(“caller_id”).first_name;     if (user == caller) {         g_form.setReadOnly(“assigned_to”, true);         g_form.setReadOnly(“assignment_group”, true);     } } Scenario 14:- User should see “xxx-xxx-xxxx” in short description on form whenever short descriptioncontains mobile number. function onSubmit() {     //Type appropriate comment here, and begin script below     var value = g_form.getValue(“short_description”);     var re = /^[0-9]{10}$/;     if (!re.test(value)) {         g_form.setValue(‘short_description’, ‘ xxx-xxx-xxxx’);         //         var res = value.replace(re, “xxx-xxx-xxxx”);         //         g_form.setValue(“short_description”, res);     } Scenario 15:- User should not submit the incident form without setting short description anddescription field values. Set the short description and description as mandatory fields. Scenario16:-Show alert if current loggedin user is member of particular group (Database). Display Business Rule (function executeRule(current, previous /*null when async*/ ) {     // Add your code here     // var groupID = current.assignment_group;     var groupName = “Database”;     var userID = gs.getUserID();     var gr = new GlideRecord(“sys_user_grmember”);     gr.addQuery(“group.name”, groupName);     gr.addQuery(“user”, userID);     gr.query();     if (gr.next()) {         g_scratchpad.grp = true} })(current, previous); On load Client Script function onLoad() {     //Type appropriate comment here, and begin script below     if (g_scratchpad.grp == true) {         alert(“The user is part of the Database group”);     } else {         alert(“The user is not part of the Database group”);     } } And since the System administrator

Scripted REST API

Scripted REST API INDEX What is Scripted Rest API?……………………………………………………………… 1 Advantages of Scripted Rest API………………………………………………………. 2 Roles Required……………………………………………………………………………. 2 Fields of Scripted Rest API……………………………………………………………… 3 Difference between Rest API and Scripted Rest API………………………………. 3 Error Codes in Scripted REST API……………………………………………………… 4 Example……………………………………………………………………………………. 4 ​​  1. What is Scripted Rest API? Scripted REST APIs allow developers to create custom web service APIs in ServiceNow. These APIs enable external systems to interact with ServiceNow by defining endpoints, handling requests, and customizing responses beyond standard table APIs. Using Scripted REST APIs, developers can: Define custom endpoints (resources) Configure HTTP methods such as GET, POST, PUT, DELETE Accept and process query parameters, path parameters, headers, and request bodies Write scripts to control request handling, business logic, and response formatting Scripted REST APIs are created and managed using the Scripted REST Service form, available under: Scripted Web Services → Scripted REST APIs This is commonly used for: Integrating ServiceNow with external systems Exposing custom data and business logic Building reusable APIs for scoped applications 2. Advantages of Scripted Rest API It gives full control over how requests and responses work You can add custom business logic using scripts It can work with multiple tables at the same time You can return custom JSON responses It supports secure access using roles and authentication You can handle errors properly with clear messages It supports API versioning for future changes It is best for integrating ServiceNow with external systems 3. Roles Required The role required to create and manage a Scripted REST API in ServiceNow is web_service_admin. 4. Fields of Scripted Rest API Field Name Description Name Friendly name of the Scripted REST API API ID Unique identifier used in the API URI Namespace Application scope where the API is created Active Enables or disables the API Default ACLs Security rules applied to all resources Base Path Base URL path for the API Version API version for managing changes Short Description / Description Explains the purpose of the API Security Configure authentication and access control Content Negotiation Define supported request and response formats (JSON, XML, etc.) Resources Define API endpoints (URI paths) Request Headers Define expected HTTP request headers Query Parameters Define supported query parameters   5. Difference between Rest API and Scripted Rest API REST API Scripted REST API Pre-built APIs provided by ServiceNow Custom APIs created by developers Mainly used for standard CRUD operations Used for custom logic and complex processing Limited customization Fully customizable using server-side scripts Follows strict ServiceNow table structure Can return custom response formats Faster to use for simple integrations Best for complex and non-standard integrations Less control over request/response Full control over headers, parameters, and payload Example: Table API, Attachment API Custom endpoints under Scripted REST APIs No scripting required Requires JavaScript scripting 6. Error Codes in Scripted REST API Error Code Meaning When It Occurs 200 OK Request successful API executed successfully 201 Created Resource created Record created via POST 400 Bad Request Invalid request Missing/invalid parameters or payload 401 Unauthorized Authentication failed Invalid or missing credentials 403 Forbidden Access denied User lacks required role/ACL 404 Not Found Resource not found Invalid endpoint or record 405 Method Not Allowed Invalid HTTP method Method not supported for resource 409 Conflict Duplicate/conflict Record already exists 415 Unsupported Media Type Invalid content type Wrong Content-Type header 500 Internal Server Error Server error Script error or exception 503 Service Unavailable Service down API temporarily unavailable 7. Example A catalog item named User Task Status exists in Instance A, which allows a manager to select a user to view the user’s task details. However, the actual task data (Incidents, Problems, and Change Requests) assigned to the selected user is maintained in Instance B. When the manager selects the User in catalog item in Instance A, the selected user information is sent to Instance B via integration. Instance B processes the request, fetches the count of Incidents, Problems, and Change Requests assigned to the user, and sends the response back to Instance A. The received response is then populated into the User Task Details variable of the catalog item. Steps of Implementation: Step 1: Create a catalog item in instance A 1.1. Create Variables Select User – reference – sys_user User Task Details – Multi Line Text 1.2. Final Catalog Item will Look Like this on Portal Step 2:  Create Scripted REST API in Instance B Create a New Scripted REST API. Navigate to ALL > System Web Services > Scripted REST API’s > New Give a name to new Scripted REST API and fill the mandatory fields as below: 2.1. Create Resource from related list Give name to a New Resource and fill mandatory fields as below: Script – This script retrieves the user from the request body, fetches the assigned user details from the User table, and returns the data in the response body to Instance A. Step 3: Create REST Message in Instance A Navigate to ALL > System Web Services > Outbound > REST Message > New 3.1. Provide Endpoint and Basic authentication details of Instance B. Give name to REST message and Endpoint of instance B 3.2. Basic Authentication Details Fill username and password details of the instance B 3.3. Create HTTP Method from related list Select HTTP method, Endpoint, HTTP Headers and Query Parameters Step 4: Create Script include to call REST Message in instance A Navigate to ALL > System Definition > Script Include > New Give a name to Script Include as below: Script- This script will fetch the user that is selected on the catalog item, calls the REST message we have created in instance A, and whatever response we get from instance B, script will fetch assignment details for the user. Step 5: Create catalog client script for your catalog item which is created in step 1 Fill the required details like Type, Catalog item, Variable Name and UI Type as below: Script – This script will get the value of the user from the

Service-now Inegration GuideLines

Service-now Integration Guidelines Service-now Webservice By default, in Service-now for every table there will be SOPA WSDL and Rest endpoints for following operations For Soap if your table name is “u_customer_table”, the WSDL will be https://instancename.service-now.com/u_customer_table.do?wsdl For Rest if your table name is “u_customer_table”, the WSDL will be https://instancename.service-now.com/api/now/table/u_customer_table Soap WSDL functions Insert update deleteMultuple getKeys deleteRecords get getRecords Rest Endpoints Methods Post Get Put Delete Soap Web Service Integration with Third Party Tool (Here we are considering as another service instance is a third party tool) Whenever we need to integrate with third party tool, we need to request the SOAP WSDL from them. Once we will get the WSDL from third party tool, we will create SOAP Message in ServiceNow. How to Create Soap Message System Navigator–>Search Soap Message as below Click on “SOAP Message” Module, you will get all the list of Soap Messages. Click on “New” UI Action. Here I am using WSDL of incident table as fallows And Save it. After Save you will get the related link at bottom of the form Click on that After Clicking on the UI Action : Generate Sample SOAP messages, it will create a WSDL xml and functions and will get one add info message at top as fallows. Click on the “insert” function in another tab. Select Authentication type as Basic one and select the same profile from reference field in Basic auth Profile and save the record. Click on the Auto Generated Variables After clicking on that, you will get all the variable in “Variable Substitution” related list Select insert.shortdescription variable and put some test value as fallows After that click on Test from related link After clicking on Test, you will get the request and response xml on the screen. If you get 200, it means, you have created an incident and in response you will get incident number as well as sys_id. Now go back to your insert function again. Click on Preview Script Usages as fallows You will get a code, which you can use in your server-side scripting.   Rest Web Service Integration with Third Party Tool (Here we are considering as another service instance is a third-party tool) Go through Navigation Search and search Rest Click on New Add the authentication type as a Basic And put values for HTPP Request And save it. Now create HTTP Method for this Message as below – to create it click on New which is on “HTTP Method” related list You will get new form, then please fill the values like below Fill the HTTP Request tab Then create HTTP query parameter and content with variable for description ${des} And save it. Then click on “Auto generate Variables” Then it will create a entry in related list of variable substitution. Put some test value for des variable and then click on TEST After clicking on Test, you will get request and response details.   Http Status Codes 2xx – Success: IT represents Request was accept successfully. 200 – Success 201- Success and record created 202 – Accepted 4xx – Error -IT represents the Request was incorrect at client only means requester. 400 – Bad Request 401– Authentication Failed 403 – Forbidden 404 -Not Found 405 -Method not Allowed 5xx -Error -It represents the request was correct but error at Server side. 500 – Internal Server Error 502 – Not Implemented 502 – Bad Gateway 503 – Service Unavailable 504- Gateway timeout

Overview of ATF

Overview of ATF Automated Test Framework (ATF) in ServiceNow The Automated Test Framework (ATF) is a built-in ServiceNow tool designed to automate testing of your instance configurations, customizations, and applications. It allows you to create and execute automated tests that verify your ServiceNow instance continues to function correctly after changes, such as upgrades, new developments, or update sets. Why Do We Need ATF? In real-world ServiceNow projects, teams often customize core processes, including: Incidents Problems Catalog Items Flows Business Rules After platform upgrades or configuration changes, these customizations can sometimes break unexpectedly. ATF addresses these challenges by: Reducing the need for repetitive manual testing Detecting issues early in the development cycle Saving significant time and resources Ensuring consistent quality and stability, especially during upgrades By automating regression testing, ATF provides confidence that your custom business processes remain intact.   ATF helps to: Reduce manual testing Catch issues early Save time Ensure quality after upgrades What Can ATF Test? ATF is versatile and can validate a wide range of elements, including: Incident creation and lifecycle Service Catalog item submissions UI Policies Client Scripts Business Rules Flow Designer logic Form field behaviors (mandatory, visible, read-only) Approval processes Server-side logic (e.g., Script Includes, SLA calculations) REST APIs and integrations (via inbound/outbound messages or MID Server) ATF supports client-side (UI) tests, server-side tests, and integration tests. Main Components of ATF ATF is built around several key components: Test A complete end-to-end scenario that verifies specific functionality. Example: Create an Incident → Set field values → Submit → Validate outcomes. Test Step Individual actions or assertions within a test. Examples: Open a form; Set field values, Click Submit, Assert field value. A single test consists of multiple ordered test steps. Test Suite A collection of related tests (or even nested suites) for organized execution. Examples: Incident Management Suite, Catalog Suite, SLA Validation Suite. Additional supporting elements include: Test Runner Executes tests and displays real-time results (Passed, Failed, and Skipped), execution time, and error details. Test Results Detailed logs with step-by-step status, runtime screenshots (for UI steps), and error messages for debugging. Scheduled Test Runs Enables automated execution on a recurring basis (daily, weekly) or tied to events like deployments or pre-upgrade validations. Types of ATF Tests ATF supports different testing approaches: UI (Client-Side) Tests Simulate real user interactions on forms, lists, and Service Portal. Example: Opening the Incident form, entering a Caller, and submitting. Server-Side Tests Validate backend logic without involving the UI. Example: Testing Business Rules, Script Includes, or SLA calculations directly. Integration Tests Verify connectivity with external systems. Example: Inbound/outbound REST APIs or MID Server interactions. Scenario Verify that an Incident record is created with specified field values. Steps to Create the Test Navigate to ATF. Go to Automated Test Framework > Tests and click New. Configure the Test Name: Create Incident – Demo Test Table: Incident Step 1: Open New Incident Form for testing (Temporary) Test Step: Open a New Form Table: Incident Purpose:  Opens the incident form Add Test Steps Step 1: Open a New Form Test Step Type: Open a New Form Table: Incident Purpose: This opens the new Incident form, simulating user navigation. Table – (Select) Incident table in the Table field (Mandatory) Submit it. Step 2: Set Field Values Test Step Type: Set Field Values Examples of fields: Short Description: Email issue Category: Software Purpose: Simulates user input on the form. Step 3: Submit the Form Test Step Type: Submit a Form Purpose: Clicks the Submit button to create the record. Click on Submit. You can see three steps on the test page in red rectangle. On the Runner page, we can see the Incident form displayed with the specified field values populated.The Caller field shows the user selected during the test execution, confirming that the correct caller information is captured.The Short Description field is filled with the provided text, validating that the input data has been passed correctly.This view helps confirm that the test is creating or opening the Incident record with the expected field values. On the Test Case record, the Test Result is shown as Success, which indicates that all the configured test steps were executed without any errors.Each step met the expected conditions and produced the correct outcome as defined in the test case.No failures, warnings, or exceptions were encountered during the execution of the test.This confirms that the related functionality is working as expected under the tested scenario. On the Incident list view, we can see that a new Incident record has been successfully created in the system.The record appears as a new row in the list with key details such as Incident Number, Short Description, Priority, State, and Assigned To.This listview allows users to quickly verify that the Incident is logged and track its current status.From here, users can also open the record to view, update, or work on the Incident in detail. The Incident record may temporarily vanish from the listview for a few minutes while the debug process is running.During this time, the system is executing background logic such as flows, business rules, or scripts, which can delay the record’s visibility.Once the debug execution is completed successfully, the Incident record will reappear in the listview.This behavior is temporary and does not indicate that the Incident has been deleted or lost. The Automated Test Framework is a powerful, native tool that streamlines testing in ServiceNow, promotes faster releases, and minimizes risks. By investing in ATF early, teams can achieve higher quality, reduced testing overhead, and greater confidence in their customizations. Start small with critical processes, build reusable steps, and gradually expand your test suites for maximum impact. Parameterized Testing Parameterized testing in ServiceNow Automated Test Framework (ATF) allows you to run the same test multiple times with different sets of input data, without duplicating the entire test. This is particularly useful for data-driven testing scenarios, such as validating a process (e.g., incident creation or user access) across various inputs like roles, values, or records. Why Use Parameterized Testing It reduces

Dictionary Entry in Service-now

Dictionary Entry in Service-now Dictionary Entry : Types Of Fields : String Reference Choice field (Dependent field)         True/false field List Journal     To find the table name of a field ,Right click on that field,Click on Configure Dictionary as shown in below picture,     Details of that field will be displayed as shown in below picture,     To add new column to a Table ,Right click on the required form, click on Configure -> Dictionary as below,     Click on New to create new field on the following form,   Clicking on New Button ,Following form will be displayed where we can create fields of different types.     e.g  create a State field of Type String as shown in below picture,   The new field can be seen in the table as below,       Choice Type Example : Lets convert the State field to Choice Type. Right click on that field, Click on Configure Dictionary, as below       State field in Dictionary Entry will be displayed. In below Section, Choice List Specification, Select Dropdown with None as a Choice ,as shown below,     Save the changes as below,     To add values in that dropdown , Click on Choices Tab in below Section, Click on New Button, as shown in below picture,     The following form will be displayed after clicking on New Button.   The List can be seen in the Dropdown as below,     Dependent Field : This field is dependent on another field in a table. e.g  City depends on State     In Dictionary Entry for City , assign Dependent field as below,     We need to set Dependent Value also, as shown below,       Now, If we select Maharashtra state, Cities from Maharashtra only displayed in City dropdown., as shown below   Similarly for other state,another cities are displayed.   You can use existing Choice table also to display the List.     Reference Field : Field refers to another field.     The Reference field User will be added to the form as below,     You can select any user from a list of users from sys_user table by clicking on magnifying glass next to User as below,     After selecting a record, Display Value of that table (Reference table) will be displayed as below,         Display Value : This Value is a representation of that record in a reference field that is for whole table.Therefore there will be only one Display Value for a table. If there are more than one display value for a table then the updated value will be set as Display value.       Clicking on Open Record button , the entire record can be seen as below,