0% found this document useful (0 votes)
188 views

Scenario Based Servicenow Interview Question - Solutions

Uploaded by

bhumika8917
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
188 views

Scenario Based Servicenow Interview Question - Solutions

Uploaded by

bhumika8917
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.

in

COMMON ASKED SERVICENOW DEVELOPER INTERVIEW


QUESTIONS AND ANSWERS

1. An end user raises an incident, but it is assigned to the


wrong group. How to troubleshoot and resolve this issue in
ServiceNow?

• Solution:
1. Check the Assignment Rules in the Incident table to
ensure they are correctly configured.
2. Verify the Assignment Group field on the incident
form to see if it was manually set or auto-populated.
3. Review the Business Rules or Workflow that might
be updating the Assignment Group.
4. Use the Debug Business Rules feature to trace the
logic.
5. If needed, update the Assignment Rules or Business
Rules to ensure proper group assignment.

2. Explain how Assignment Rules or Business Rules can help


automate proper assignment in Incident Management.

• Solution:
o Assignment Rules:
▪ Define conditions (e.g., category, priority) to
automatically assign incidents to the correct
group.
▪ Example: Assign all "Network" category

incidents to the "Network Support" group.


o Business Rules:
▪ Use server-side scripts to automate assignments
based on complex logic.
▪ Example: If the incident priority is "High," assign

it to the "Critical Issues" group.


o Best Practice: Use Assignment Rules for simple logic
and Business Rules for advanced scenarios.

©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in


©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in

3. Explain the lifecycle of a Change Request in ITSM, and


highlight how you would implement approval workflows.

• Solution:
o Lifecycle:
1. Request: A user submits a Change Request.
2. Review: The request is reviewed for feasibility
and risk.
3. Approval: Approved by stakeholders (e.g., CAB).
4. Implementation: The change is executed.
5. Validation: The change is tested and verified.
6. Closure: The request is closed.
o Approval Workflow:
▪ Use the Workflow Editor to create a flow with
approval tasks.
▪ Example: Add an "Approval - CAB" task with
conditions based on risk level.

4. What is the difference between Client Scripts and


Business Rules? Provide an example use case for each.

• Solution:
o Client Scripts:
▪ Run in the user’s browser (client-side).
▪ Example: Validate a field on a form before

submission.
o Business Rules:
▪ Run on the server-side when a record is
inserted, updated, or queried.
▪ Example: Automatically update the "Priority"
field based on the "Impact" and "Urgency"
fields.

©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in


©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in

5. How to debug a Client Script that isn’t working as


expected?

• Solution:
1. Open the Script Debugger in the browser console.
2. Add console.log() statements to trace the script
execution.
3. Check for errors in the console.
4. Verify the script’s conditions and ensure it’s triggered
on the correct event (e.g., onChange, onSubmit).

6. Write a Client Script to auto-populate the 'Caller' field in


an Incident form based on the logged-in user.

• Solution:

function onChange(control, oldValue, newValue, isLoading) {


if (isLoading) {
var callerField = g_form.getReference('caller_id');
var currentUser = g_user.userID;
g_form.setValue('caller_id', currentUser);
}
}
• Trigger: OnLoad

©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in


©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in

7. Modify this script to fetch the user’s department and


display it in another field.

• Solution:

function onChange(control, oldValue, newValue, isLoading) {


if (isLoading) {
var currentUser = g_user.userID;
var userGR = new GlideRecord('sys_user');
if (userGR.get(currentUser)) {
g_form.setValue('caller_id', currentUser);
g_form.setValue('department', userGR.department);
}
}
}
• Trigger: OnLoad

8. How can you ensure that a catalog item follows an


approval workflow before fulfillment? Walk me through
the process.

• Solution:
1. Open the Catalog Item in ServiceNow.
2. Go to the Workflow tab and select an approval
workflow (e.g., "Catalog Item Approval").
3. Configure the workflow to include approval tasks
(e.g., Manager Approval).
4. Test the workflow by submitting the catalog item.

©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in


©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in

9. Create a Catalog Item named 'Laptop Request' with the


following fields:

• Solution:
1. Open Service Catalog > Catalog Items > Create
New.
2. Add fields:
▪ Name of the Requestor (Default: Logged-in
User)
▪ Type of Laptop (Dropdown: Standard, High

Performance)
▪ Justification (Text Area)

3. Attach an approval workflow:


▪ Add an "Approval - User Criteria" task to send
an email to the manager.

10. What are the key components of SLA in ServiceNow?


How to configure an SLA for resolving incidents within 4
hours?

• Solution:
o Components:
1. SLA Definition: Conditions for when the SLA
applies.
2. Schedule: Business hours for SLA calculation.
3. Breach Time: Time limit for resolution.
o Configuration:
1. Go to SLAs > Create New.
2. Set conditions (e.g., Priority = High).
3. Set breach time to 4 hours.

©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in


©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in

11. Configure an SLA that applies to incidents with a


priority of 'High' and sends an escalation email if the SLA
breaches.

• Solution:
1. Create an SLA Definition with conditions: Priority =
High.
2. Set breach time (e.g., 2 hours).
3. Add a notification in the workflow to send an email
on SLA breach.

12. A notification email is not triggering when a record is


updated. How to troubleshoot and resolve this issue?

• Solution:
1. Check the Notification record to ensure it’s active
and conditions are met.
2. Verify the Email Script for errors.
3. Use the System Logs to trace the notification
execution.

13. Set up an email notification for incidents that are


resolved. Ensure the email includes the incident number
and resolution notes.

• Solution:
1. Go to System Notification > Email > Create New.
2. Set conditions: State = Resolved.
3. Add email content:
▪ Incident Number: ${incident.number}
▪ Resolution Notes: ${incident.close_notes}

©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in


©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in

Scenario-Based Questions:

1. Leave Request Form:

• Client Script (onChange):

function onChange(control, oldValue, newValue, isLoading) {


if (newValue === 'Sick Leave') {
g_form.setMandatory('start_date', true);
g_form.setVisible('start_date', true);
} else {
g_form.setMandatory('start_date', false);
g_form.setVisible('start_date', false);
}
}
• Validation:

function onSubmit() {
var leaveType = g_form.getValue('leave_type');
var startDate = g_form.getValue('start_date');
if (leaveType === 'Sick Leave' && !startDate) {
alert('Start Date is mandatory for Sick Leave.');
return false;
}
return true;
}

©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in


©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in

2. HRSD Service Request Form:

• Client Script (onChange):

function onChange(control, oldValue, newValue, isLoading) {


var userGR = new GlideRecord('sys_user');
userGR.addQuery('job_title', newValue);
userGR.query();
if (userGR.next()) {
g_form.setValue('employee_id', userGR.sys_id);
} else {
alert('No Employee ID found for the selected Job Title.');
}
}

3. ITSM Form Validation:

• Client Script (onSubmit):



function onSubmit() {
var email = g_form.getValue('email');
if (!isValidEmail(email)) {
alert('Invalid email address. Please enter a valid email.');
return false;
}
return true;
}

function isValidEmail(email) {
var regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return regex.test(email);
}

©️HackNow Call/WhatsApp: +91 8984988593 Visit: https://hacknow.co.in

You might also like