Combining Activity logs of Parent and Child requests

Nivlac1000
Kilo Expert

I can't seem to find where there is   the ability to combine the Activity logs from a Parent and a Child task into one continuous chronological view.   I can see a business case for this when you have multiple TASKs under a RITM that need to coordinate and see updates from each child in the parent view.   Am I missing something in the wiki? Or has anyone done something like this before?

 

TIA,

Cal

7 REPLIES 7

Nick_Minnich1
Giga Contributor

I don't know of any simple out of box answer, but you could accomplish this with a business rule.



You could write a business rule on the child table that updates the parent records additional comments field with the new notes. You can write something like this in an on update BR.


current.parent.additional_comments = "Update from Task" + current.number + " " + current.additional_comments;



That would clarify the update was coming from the child task. You will need to worry about notifications going out since this will be triggering those on the parent record if they are set up for the additional comments field.


Bhavesh Jain1
Giga Guru

I agree with Nick.


We had a similar requirement and we created a business rule on child table to automatically update comments of parent with similar comments mentioned by Nick.


So your code would be:



var parent = current.parent.getRefRecord();


parent.comments =   "Update from Task" + current.number + " " + current.comments;


Here's another twist, how can you push the parent updates down to the Child?   That seems to be the complaint of the engineers working TASKs and customers updating RITMs. It'd be great to have a clean view of a single Activity Log for both the Parent and all the children.


To copy comments from parent to child, write a BR on parent table when current.comment.changes()



var gr = new GlideRecord('sc_task');


gr.addQuery('parent',current.sys_id);


gr.query();


    while (gr.next()) {


          gr.comment = current.comments;


          gr.update();


    }




Make sure you dont run into infinite loop by writing this BR on both child as well as parent table.