Adding child ticket number for notes to parent incident notes section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2016 03:58 PM
Hi, we currently have something setup in our dev instance for testing where we can create child tickets for incidents which can then be assigned to other departments to work on. Most of this is setup now.
One last problem we are having is that when we enter a comment in the notes section of the child ticket, they are showing up in the parent incident but there is no indicator like a ticket number so we don't know which child ticket is being updated.
It only shows this in the parent incident (notes entered in the child ticket). What would be great would be to have the number displayed as well. I think the right way to go about this is to create a business rule but am not sure.
2016-04-25 15:36:13 My Name Changed: Additional comments, Work notes
blah blah
blah blah
thanks for any help,
Derek
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2016 05:31 PM
The updating of child incidents is control by the business rule: Update Child Incidents
You can make a copy of the rule, inactive the original, and make the following change in your new rule. There is 3 or 4 places you will have to update it but this should make sense once you see how to do it.
Change:
var msg = "Comment copied from Parent Incident"; |
to
var msg = "Comment copied from Parent Incident " + rec.number; |
In the Child incident, you will see: Comment copied from Parent Incident INC0000044: blah blah blah.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2016 06:40 PM
@Michael... I think he actually wants the information to flow the opposite way... from child to parent.
@Derek....But it would work essentially the same as Michael says. You will need to write your own business rule to copy information from Child-->Parent, but it will be much simpler since you are only updating a single record (the parent) as opposed to a collection of records (the children).
Here is one we use for updating any type of parent task when one of its child tasks gets completed... feel free to adapt to your purposes. It includes a link back to the child task, and is written as an After business rule running on the [task] table (Insert/Update) whenever "Parent is not Empty" and "Active changes to False"... change this condition to accommodate your purpose as well.
function onAfter(current, previous) {
//This function will be automatically called when this rule is processed.
var parent = current.parent.getRefRecord();
var taskURL = gs.getProperty('glide.servlet.uri') + current.getLink(true);
var childLink = '<a href="' + taskURL + '">' + current.number + '</a>';
parent.work_notes = "[code]<b>Task Completed (" + childLink + "):</b> " + current.short_description + "<p><b>State:</b> " + current.getDisplayValue('state') + "<p><b>Completion Notes:</b> " + current.close_notes + "[/code]";
parent.update();
}
Good luck,
-Brian

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2016 06:47 PM
Doing that could put the scripts into a never ending loop. Usually Comments and/or Work Notes always push from Parent, never the other way.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2016 07:15 PM
It shouldn't, unless you've allowed circular references between your tasks, which should be disallowed anyway IMHO. And if you think about it, the same thing could happen pushing updates to children if circular references are being allowed.
But if you are worried about it looping, you can always add a "parent.setWorkflow(false)" prior to the update to prevent other automated updates. We've found it useful having the child info bubble-up to the parent instead of forcing a user to drill down to get all the data.
-Brian