- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 08:58 AM
Hello to all !
I'm looking for the best way to send tasks like Change, HR_Case or Incident,
from a record producer,
with the name of the record producer in the short_description.
For example :
>>>
Nothing found in the wiki,
I'm sure you've did this before, can you give me some advice ?
Thank you !
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2016 09:26 PM
Hi Vincent,
One easy way to achieve this would be:
Create a variable on Record producer(name: short_description), as follows:
Dont forget to add Default value as: javascript:current.cat_item
And you're done.
Now, if you want, you can write a Catalog UI policy to hide the variable 'short_description' containing the name of the Record producer, as:
Thanks,
Deepak.
PS: Hit like, Helpful or Correct depending on the impact of the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2016 01:34 PM
Vincent,
I'm looking to do this in a manner where I can use the same script, such as a UI Script or possibly a client script, to get the result you're looking for. I've not yet figured that out but I am able to do it using a catalog client script on each producer.
1. Created a variable set
2. Added one single line text variable to it. Name is unimportant but named mine producer_sys_id
3. Added variable set to producer
4. UI Policy to hide producer_sys_id
5. onLoad Catalog Client Script for producer with the following
function onLoad() {
var SYSID = $('sysparm_id').value;
g_form.setValue('producer_sys_id', SYSID);
}
6. Added the following code to the script section on the producer's "What it will contain" tab.
var gr = new GlideRecord('sc_cat_item_producer');
gr.addQuery('sys_id', producer.producer_sys_id);
gr.query();
if (gr.next())
ShortDescription = gr.name + ' - ';
else
ShortDescription = 'T&E Issue - ';
7. Results in:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2016 09:26 PM
Hi Vincent,
One easy way to achieve this would be:
Create a variable on Record producer(name: short_description), as follows:
Dont forget to add Default value as: javascript:current.cat_item
And you're done.
Now, if you want, you can write a Catalog UI policy to hide the variable 'short_description' containing the name of the Record producer, as:
Thanks,
Deepak.
PS: Hit like, Helpful or Correct depending on the impact of the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2016 06:31 AM
Hi Vincent, http://www.servicenowguru.com/reporting/identify-servicenow-record-producer-create-record/ Above article might assists you. For record producers, there in no direct relationship OOB between Record producers and TASK. We see this relationship between catalog item and sc_req_item (RITM). sc_req_item table has a reference field referencing to sc_cat_item table( cat_item is field name). This is very easily possible for catalog items and service requests. For record producers, you might have to check above article

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 02:43 PM
Thanks Deepak Ingale.. upon review and reading the comments from servicenowguru.com link you provided someone posted what worked for me. I added to the Script field the following to get the name of the Template used:
var template = cat_item.template.name;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2019 06:00 PM
Here is a business rule script on before insert that worked for us for each table:
(function executeRule(current, previous) {
var rpid = RP.getParameterValue('sysparm_id');
var rpt = new GlideRecord('sc_cat_item_producer');
rpt.addQuery('sys_id', rpid);
rpt.addQuery('sys_id', '!=' ,'');
rpt.query();
if (rpt.next()) {
current.short_description = current.short_description + " - Using Producer: " + rpt.name;
}
})(current, previous);