Add Problem Task resolution information to problem but don´t replace problem resolution notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 06:36 AM
When the task is completed, the following information should be transferred from the task to the problem:
- "Workaround" (task) is written to the "Workaround" (problem) field if content is available
- "Notes on cause" (task) is written to the "Notes on cause" field if content is available
- "Notes on proposed solution" (problem) is written to the "Notes on solution" field, if content is available.
The contents of the problem fields should not be overwritten, but the new information should be preceded by the date/time in the fields and separated
"Date/Time (new)
Workaround information (new)
----------------------------------
Date/Time (old)
Workaround information (old)"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 07:08 AM - edited 12-11-2023 07:09 AM
Hi @jthomsen ,
Write a BR [after: update] on problem task table, and update the task value to problem record via parent column record, while updating PRB record use the concatenation for fields and user ("\n") for line break. Share the code if you stuck in steps.
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 07:19 AM
Hi @AshishKM ,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 09:47 AM
Hi @jthomsen ,
Replace the code with below updated code, this code will update the PRB with existing update.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var prob = new GlideRecord('problem');
prob.addQuery('sys_id', current.problem);
prob.query();
var gdt = new GlideDate().getDate();
if (prob.next()) {
prob.workaround = current.workaround + "(" + gdt + ")" + "<hr>" + prob.workaround;
prob.cause_notes = current.cause_notes + "(" + gdt + ")" + "<hr>" + prob.cause_notes;
prob.fix_notes = current.fix_notes + "(" + gdt + ")" + "<hr>" + prob.fix_notes;
prob.update();
}
})(current, previous);
Test this first and you can add all 3 fields together for "hints_to_solution".
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution