- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2018 06:34 PM
Hi All
For our on-boarding process we receive email from the HR with new employee details to ServiceNow; ServiceNow then creates a request to the helpdesk. From the RITM form, Helpdesk uses the UI action to create the new user in AD. By clicking the UI Action, it will open to a service catalog called 'create a user to AD' and the new user details will be auto populated to the RITM form. On submitting, the new user will be created in AD.
I am able to bring the parent RITM number to the new request. I need help for updating the work notes of the parent RITM with the "Create new user in AD" request number or RITM number so the helpdesk will know for which request the new user was created.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2018 03:15 PM
I could achieve this by Business Script
Condition
Item is “Create a new user in AD”
(function executeRule(current, previous /*null when async*/) {
var req_num = current.request.getDisplayValue();
var getInci = current.u_neo_reference_request.getRefRecord();
getInci.work_notes = "Request "+req_num+" has been created for creating the new user on AD";
getInci.update();
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2018 06:41 PM
Can you share your code that gives you RITM number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2018 07:33 PM
Step 1: Created the reference field “reference request” on the service catalog.
Step 2: Created reference field “Neo Reference request” on the RITM form.
Step 3: Used Catalog Client Script
function onLoad() {
var url = document.URL.parseQuery();
var sysID = getParameterValue17(url,'sysparm_sysid');
if(sysID)
g_form.setValue('reference_request',sysID);
function getParameterValue17(url,sysID) {
if (url[sysID]) {
return decodeURI(url[sysID]);
} else {
return;
}
}
Step 4: Workflow
Added Run Script
current.u_neo_reference_request=current.variables.reference_request;
If this helped you please mark it useful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2018 07:08 PM
Hi - sorry that my coding is not good but I believe you can do the following
Create a business rule that identifies the fields have been changed - eg Login field changes from empty
parentitm.comments = current.variables.accountname;
The above logic is to
select the value from the parent field (ie the ticket)
Add to the comments section the value that is in the variable that has been updated
Below is the code to pass information from an RITM to a task. All you want to do is replace the sc_task table with the table name that your parent ticket sits in
var thisRITM = current.number; //thisRITM is the one just commented
var cc = current.work_notes; //get the current work notes before updated
var ReqTask = new GlideRecord('sc_task'); //query for any tasks associated to thisRITM
ReqTask.addQuery('request_item.number', thisRITM);
ReqTask.query();
while (ReqTask.next()){
ReqTask.work_notes = thisRITM + " - Work Notes updated: \n" + cc; //update the comments into worknotes in the tasks with the comments from the RITM
ReqTask.setWorkflow(false);
ReqTask.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2018 03:15 PM
I could achieve this by Business Script
Condition
Item is “Create a new user in AD”
(function executeRule(current, previous /*null when async*/) {
var req_num = current.request.getDisplayValue();
var getInci = current.u_neo_reference_request.getRefRecord();
getInci.work_notes = "Request "+req_num+" has been created for creating the new user on AD";
getInci.update();
})(current, previous);