- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 02:48 AM
Hi, I am working on a CSM Project and would like to map the below from when a record producer is used, directly into the fields of a case.
Mapping required:
1. Name (Record producer) -> Short Description (Case)
If a certain record producer is used it automatically maps to the short description of the case
2. Requester (Submitter) - > Internal User (Case)
The Requesters name also populates in the internal use field of the case.
3. Categories - > Case Type
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 06:54 AM
Hi Daniel,
You can use a script like this in the Script field on the Record Producer definition to populate these fields on the resulting Case record from data that is on the Catalog Item/Record Producer:
var rpsysid = RP.getParameterValue('sysparm_id');
var catitem = new GlideRecord('sc_cat_item');
if (catitem.get(rpsysid)) {
current.short_description = catitem.name;
}
current.internal_user = current.opened_by;
var catArr = [];
var cats = new GlideRecord('sc_cat_item_category');
cats.addQuery('sc_cat_item', rpsysid);
cats.query();
while (cats.next()) {
catArr.push(cats.sc_category.title);
}
current.u_case_type = catArr.join(', ');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 01:30 AM
@Brad Bowman - You massively helped me here, I have another open question to do with setting default values on record producers, I have been told I could use onload client scripts, or variable attributes, etc. But just wanted confirmation on how I could do this and how I can set the default value. I have provided the link below to my other question, so feel free to also reply to that question, if you are free and able to help. It would be greatly appreciated.
https://www.servicenow.com/community/csm-forum/how-can-i-set-a-default-value-of-the-requesters-compa...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2023 03:52 PM
How does adding this information to a record producer map the fields to the case. Is there another place I need to go so that the system knows what Record Producer to call for a particular Catalog Item (Request). Also do you know how I can associate particular catalog items to particular case types and case tables?
Thanks,
Stacy