- 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-25-2022 06:27 AM
HI Daniel,
If you are creating the record producer via the New button on Service Catalog | Catalog Definitions |Record producers, you should see a check box in the variable definition Map to Field. Checking that box exposes the two other fields that you need, what field and what table. What table is read only because you need to identify the table when defining the record producer.
:{)
Helpful and Correct tags are appreciated and help others to find information faster
- 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-26-2022 03:50 AM
@Brad Bowman - This is exactly what I needed. Thanks for your help Brad, It is much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 05:35 AM
You are welcome!