ServiceNow Interview Questions and Answers – User Shared Q&A (Set 7)

Harish Gadi 2023-09-07 05:04:12
How to create a problem record for 5 th incident in incident list Example: there are 10 incidents we need to create a problem ticket for incident for 5 th incident only ?

Surendra 2023-10-24 22:31:11
var gr = new GlideRecord('incident'); gr.orderByDesc('sys_created_on'); //gr.setLimit(10); gr.chooseWindow(4,5);// 4-first row and 5- last row gr.query(); while(gr.next()){ gs.print(gr.number); // create problem record here }
0 Helpfuls
0 Helpfuls


Harika 2023-09-07 23:36:06
I need to create a catalog item, in that catalog item I need to generate 10 catalog tasks simultaneously. How can I achieve this?

Rohit 2023-09-20 13:04:31
create a Workflow that will be associated with your catalog item. This workflow should define the logic for generating 10 catalog tasks simultaneously.
0 Helpfuls
0 Helpfuls


vishnu 2023-09-11 04:16:32
scenario: for eg your client is asked to implement approval for standard change.. then how can you achieve this.

Praveen 2023-09-22 22:16:23
You can achieve this by modifying the OOB change workflow
0 Helpfuls
0 Helpfuls


ksr 2023-09-13 22:18:38
how to handle errors in restapi?

Pranav 2023-10-31 09:54:42
You can handle errors based on response status code. You get status code in series 400 if there is any error e.g. 1. 402 is error code for incorrect user details 2. 404 is either the URL you have configured doesn't exist at all, or the resource you are trying to access doesn't exist.
0 Helpfuls
Mustafeez 2024-01-12 14:47:59
There's also ERROR 401. It's for Basic authorization error.
0 Helpfuls
1 Helpfuls


Varad Bhagwat 2023-09-17 01:02:13
What is Blackout and Maintenance window in change management?

Kapil Don 2023-09-26 05:10:08
Blackout windows specify times during which normal change activity should not be scheduled. Maintenance windows specify times during which change requests should be scheduled.
0 Helpfuls
1 Helpfuls


Jatin Sehgal 2023-09-18 05:59:50
If there are 5 ACLs and 4 are denying access and 1 is granting access. Will the user be granted access or not?

Anubhav 2023-09-26 11:57:12
Yes, user will be granted access.
0 Helpfuls
2 Helpfuls


Rohit 2023-09-20 11:39:25
The interviewer asked if we need Email in the email field when user field is filled it automatically populated in the INC form. So, I said we can achieve by the client script we use getrefrence field (Sys_ID) he needs more info so please answer it

Laxmi 2023-10-26 19:29:20
Ypu can use below script: function onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; } //if(newValue != ''){ var caller = g_form.getReference('caller_id'); g_form.setValue('u_email', caller.email); //} }
0 Helpfuls
Pratiksha Langde 2023-10-27 10:24:51
getReference is not the best practice to get data from server side to client side. we should be using GlideAjax to fetch data from server side to client side. if you want to use getReference then you can use this code using on change client script : unction onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; } //Type appropriate comment here, and begin script below var user = g_form.getreference('requested_for', function(user) {// map the correct field g_form.setValue('u_email', user.email.toString());// map the correct field }); } if you want to auto-populate the email id based on logged-in user the please line in the default value of the email id field : javascript: gs.getuser().getRecord().getValue('email); Using GlideAjax : Create a new client callable script include with following function var UserDetails = Class.create(); UserDetails.prototype = Object.extendsObject(global.AbstractAjaxProcessor, { getUserInfo: function() { var details = {}; var userId = this.getParameter('sysparm_user_id'); var userObj = new GlideRecord('sys_user'); userObj.addQuery('sys_id', userId); userObj.query(); if (userObj.next()) { details.email= userObj.email_id.toString(); } return JSON.stringify(details); }, type: 'UserDetails' }); Create a new catalog client script on the record producer/request form function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } var ajax = new GlideAjax('UserDetails'); ajax.addParam('sysparm_name', 'getUserInfo'); ajax.addParam('sysparm_user_id', g_form.getValue('employee_name')); // change variable name here ajax.getXML(doSomething); function doSomething(response) { var answer = response.responseXML.documentElement.getAttribute("answer"); var answers = JSON.parse(answer); g_form.setValue('var_email_id', answers.email.toString()); // change variable name here } }
2 Helpfuls
Rohit 2023-11-16 05:27:34
Do we need an additional field of 'Email' to auto-populate the email address of user?
0 Helpfuls
Tanya 2023-11-28 05:19:31
no
0 Helpfuls
Soumaya 2023-11-28 11:41:35
If you would like to show email address of user on incident form then we can dot walk to user reference field and bring email field on task form. This way, we don't need to write any script to populate email address when user is changed.
1 Helpfuls
0 Helpfuls


Rohit 2023-09-21 00:21:19
The interviewer asked me How to restrict the location in the service catalog by the locations based clients in ServiceNow

Vaishnavi 2023-09-30 00:06:03
We can use reference qualifier to restrict certain locations based on users location.
0 Helpfuls
Manimegala 2024-04-08 07:22:07
In order to restrict for specific location, We can create usercriteria which will have location as mentioned under 'Not Available For' tab in service catalog
0 Helpfuls
0 Helpfuls


Satyapriya Biswal 2023-09-21 03:19:25
What are major incidents? Is all P1 incidents are major incidents?

Baxter 2023-11-02 08:29:45
I believe Major Incidents have their own separate work flows and notifications outside of standard incident management. With most incidents of any priority, the incident management team is usually equipped to find a solution and additional approval is usually not required. Even P1 incidents go throught the same workflow of a P2 or P3 incident. Major incidents involve notifications that get sent outside of the incident management team and have unique workflows that are more complex or require further approval in order to resolve the issue. I'm sure other poeple can describe this better, but in short, Major Incident Management is its own separate entity.
1 Helpfuls
0 Helpfuls


Atharva Chavan 2023-09-23 07:15:58
Use of Jelly Script with an example
2 Helpfuls






Fuel My Passion

Loving the content? Well, of course you are. Here’s your chance to indirectly fuel the chaos that keeps this website running. Your contribution helps keep the wheels turning and allows me to continue pretending to be a responsible adult—while cranking out more content for you. Thanks for supporting my delusional dreams and helping me keep this website alive!


Buy Me a Coffee

Support with UPI

If you prefer making a UPI payment to support the website maintenance cost, scan the QR code below:

UPI QR Code

Comments