- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2022 02:58 AM
Create a Business Rule which will trigger when new record will be inserted in Incident table then create a new record in Customer Incident table
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 02:19 AM
Hi,
Why not use flow designer for this with no script?
try to use this script and share the update
(function executeRule(current, previous) {
var gr = new GlideRecord('u_customer_incidents');
gr.initialize();
gr.u_category = current.category;
gr.u_subcategory=current.subcategory;
gr.u_parent_inc=current.number;
gr.u_state=current.state;
gr.u_description=current.description;
gr.u_short_description=current.short_description;
gr.u_caller=current.caller;
gr.insert();
gs.addInfoMessage("The customer incident " + gr.getDisplayValue() +" has been created");
})(current, previous);
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
‎06-30-2022 06:36 AM
Hi Avinash,
The answer provided by
Thanks and Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 01:29 AM
Hi ,
Thanks for the solution.
The Data from number (Incident table) is not getting transferred into customer incident table.
i am using this code :
(function executeRule(current, previous) {
var gr = new GlideRecord('u_customer_incidents');
gr.newRecord();
gr.u_category = current.category;
gr.u_subcategory=current.subcategory;
gr.u_parent_inc=current.number;
gr.u_state=current.state;
gr.u_description=current.description;
gr.u_short_description=current.short_description;
gr.u_caller=current.caller;
gr.insert();
gs.addInfoMessage("The customer incident " + gr.number +" has been created");
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 01:35 AM
Hello,
Try with
(function executeRule(current, previous) {
var gr = new GlideRecord('u_customer_incidents');
gr.newRecord();
gr.u_category = current.category;
gr.u_subcategory=current.subcategory;
gr.u_parent_inc=current.number;
gr.u_state=current.state;
gr.u_description=current.description;
gr.u_short_description=current.short_description;
gr.u_caller=current.caller;
gr.update();
gs.addInfoMessage("The customer incident " + gr.number +" has been created");
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 02:19 AM
Hi,
Why not use flow designer for this with no script?
try to use this script and share the update
(function executeRule(current, previous) {
var gr = new GlideRecord('u_customer_incidents');
gr.initialize();
gr.u_category = current.category;
gr.u_subcategory=current.subcategory;
gr.u_parent_inc=current.number;
gr.u_state=current.state;
gr.u_description=current.description;
gr.u_short_description=current.short_description;
gr.u_caller=current.caller;
gr.insert();
gs.addInfoMessage("The customer incident " + gr.getDisplayValue() +" has been created");
})(current, previous);
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
‎07-01-2022 02:48 AM
Thanks for the help