- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2022 10:34 PM
Hi All,
My requirement is like
1. If I open a change form and click on the order button [which I created by UI action]
2. Then it should redirect to the service portal to a particular item [This is done]
3. After the catalog item is requested then the RITM number should populate in the work notes of the change form i.e. for example RITMXXXX is created
Can you help me with this
Thanks,
Rushikesh
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2022 03:40 AM
then update as this
action.setRedirectURL('sp?id=sc_cat_item&sys_id=119c3de01b02011014d099f7b04bcb02&sysparm_chg=' + current.sys_id);
Then have onLoad catalog client script on your catalog item
function onLoad(){
var url = top.location.href;
var chg = new URLSearchParams(url).get("sysparm_chg");
g_form.setValue('variableName', chg);
}
Then have workflow run script
var chg = new GlideRecord('change_request');
if(chg.get(current.variables.variableName)){
chg.work_notes = current.number + ' is created';
chg.update();
}
You need to create text variable and hide it always on catalog form and RITM form as well
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
‎03-28-2022 10:51 PM
Hi Rushi
While redirecting to particular catalog item, are you passing the details of change to your catalog form?
3 Ways to Populate Values in ServiceNow via the URL
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2022 10:56 PM
Hi,
are you linking the CHG and RITM?
Are you populating CHG number in some variable of your catalog item? if yes then you can use workflow run script to update work notes of CHG form by querying CHG table
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
‎03-28-2022 11:17 PM
Hi,
My requirement is that I have to populate the RITM number to the work notes of the change form upon request of catalog item.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2022 11:25 PM
You can achieve it using a Business rule, here is the code and configuration:
Mark my answer correct & Helpful, if Applicable.