- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 10:15 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 10:26 PM
Hi
This is done with a UI action called "Create Problem". It is available from the form menu (or right-click on the form header.) You can find the definition for this UI action in your instance here:
If you are looking at a BR, then below script in before BR on incident table:
- Configuration item
- Priority
- Assignment group
- Short Description
- Description
(function executeRule(current, previous /*null when async*/) {
var newPRB = new GlideRecord('problem');
newPRB.cmdb_ci = current.cmdb_ci;
newPRB.location = current.location;
newPRB.short_description = 'PRB raised' + current.number + ' - Auto Generated';
newPRB.description = 'PRB raised ' + current.number + '\nIncident description: ' + current.description;
newPRB.assignment_group = current.assignment_group;
newPRB.insert();
current.problem_id = newPRB.sys_id;
})(current, previous);
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 10:26 PM
Hi
This is done with a UI action called "Create Problem". It is available from the form menu (or right-click on the form header.) You can find the definition for this UI action in your instance here:
If you are looking at a BR, then below script in before BR on incident table:
- Configuration item
- Priority
- Assignment group
- Short Description
- Description
(function executeRule(current, previous /*null when async*/) {
var newPRB = new GlideRecord('problem');
newPRB.cmdb_ci = current.cmdb_ci;
newPRB.location = current.location;
newPRB.short_description = 'PRB raised' + current.number + ' - Auto Generated';
newPRB.description = 'PRB raised ' + current.number + '\nIncident description: ' + current.description;
newPRB.assignment_group = current.assignment_group;
newPRB.insert();
current.problem_id = newPRB.sys_id;
})(current, previous);
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 11:22 PM
Hi
Kindly mark the applicable answer as Correct & Helpful both such that others can get help.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 10:35 PM
Hi Sai,
Please use the BR and do the field mapping before you apply it. In the BR, set the Table as "Incident".
In the field mapping, prb contains the problem ticket that is going to be created and current is the incident table.
(function executeRule(current, previous /*null when async*/ ) {
var prb = new GlideRecord('problem');
prb.initialize();
prb.<fieldName> = current.<fieldName>; // do the field mapping
.
.
.
.
prb.insert();
})(current, previous);
Regards,
Snehangshu Sarkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 11:36 PM
user after business rule on incident table, mark it after insert.
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord("problem");
gr.initialize();
gr.short_description = current.short_description;
gr.first_reported_by_task = current.sys_id;
gr.assingment_group = current.assingment_group;
gr.description = "this is a problem record created by an incident";
gr.cmdb_ci = current.cmdb_ci;
gr.insert();
})(current, previous);
Please mark an appropriate response as correct if my answer replied to your question.