How to retrieve a variable value from a RITM and Populate on a the same field in a new request, Thanks so much.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2020 10:26 PM
Hi, Please help on how to retrieve a variable value from a RITM and Populate on a the same field in a new request, Thanks so much.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2020 11:15 PM
any example script and steps will be a great help, Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2020 11:20 PM
Hi,
Ok so you need to get the variable value of previous RITM submitted by that user and auto-populate it in the variable
Can you share how to identify same user's previous request? if there any variable which holds user record
For this you would require onload client script and combination of GlideAjax
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2020 11:55 PM
user query can be on sys_user table.
current user Variable is : var req = g_form.getReference('requested_by_name',callback);
---------------------------------------------------------------------------------------
have done as shown below to query a catalog item approval status,
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('state','requested');
gr.addQuery('sysapproval.sys_item_name', 'sc_req_item');
gr.orderBy('approver');
gr.query();
while (gr.next())
{
var documentId = gr.document_id;
var req = new GlideRecord('sc_req_item');
req.addQuery('sys_id', documentId );
req.addQuery('cat_item','sys_id_of_item');
req.query();
gs.log(req);
gs.log(gr);
while(req.next())
{
gs.eventQueue('open.approval.reminders.********', gr, gr.approver.sys_id);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 12:02 AM
Hi,
You need onload catalog client script + GlideAjax
the script you shared doesn't look will achieve your requirement
Is this for your personal instance? if yes then if you are ok you can share details
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 05:29 PM
Details?