Record producer script to populate the values in incident from record producer variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 12:49 AM
Create a record producer script to populate name in incident short description
Name of the record producer == Short description( incident)
after submit the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 01:38 AM
Hi @FaizDev101 ,
I am not sure you can get the name of producer in producer script, instead how about using BR to populate that value after the incident is created?
If so, creating BR on table sc_item_produced_record - before - Insert with the Condition 'Record table' is incident, and the script is:
var gr = new GlideRecord('incident');
if (gr.get(current.task)) {
gr.short_description = current.producer.getDisplayValue();
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 02:09 AM - edited 06-21-2023 02:10 AM
Hi @FaizDev101 ,
Create a variable (single line text)[eg of variable name : record_producer_name] and check the hidden (so that the variable is not visible in the form)
Default value : javascript:current.cat_item;
and in the record producer script use current.short_description = producer.record_producer_name.getDisplayValue();
Please mark this as helpful and correct answer, if this helps you
Shravan
Please mark this as helpful and correct answer, if this helps you