Copying task comments to RITM without sending duplicate emails, or displaying task comments in Service Portal?.

MB12
Kilo Sage

We have notifications setup to email the requested_for user whenever a comment is added either at the RITM OR task level. The issue I'm running into is... when the fulfiller adds comments into a task, or the end-user replies to these comments within the task, the end-user is not able to see them in the service portal when checking the status of their request. 

 

Is there a business rule/script I can use to copy the comments from task to RITM without sending a duplicate notification? Alternatively, can task comments be made visible within service portal? 

 

Background:

I have two email notifications setup - one on the sc_task, and the other on the sc_req_item table. Both notifications are set to send when a record is inserted or updated with the conditions: Additional Comments Changes, and State is not Closed/Closed Incomplete. 

 

When a user replies to a task level notification, we have an inbound action to add their email reply into the task comments field.

 

 

Thank you! 

1 ACCEPTED SOLUTION

Michael Jones -
Giga Sage

With your current configuration I don't see a way to satisfy all of your requirements without sending double the notifications at the RITM level; I also don't see an easy way to make comments at the task level visible via the portal 

Are the notifications at the RITM level for comments really necessary - as in - do these provide value? Are they being updated for work outside of the tasks?

If your primary goals are to make all comments at the RITM level visible in the Portal, and maintain the ability for a user to reply directly to comments at the task level then my best suggestion would be to disable the notification at the the RITM level and drive all comments from tasks. 

You would create a business rule to push all comments placed in a task up to the RITM (which make them visible on the portal) but rely on the notification at the task level to inform the user, and allow for the response to flow back to the appropriate task. 

The business rule would be relatively simple (this assumes you really are using comments on task, not work_notes) 

Table: sc_task

After / Update

Advanced:

(function executeRule(current, previous /*null when async*/ ) {

    var comments = current.comments.getJournalEntry(1);
    var RITM = new GlideRecord('sc_req_item');
    RITM.get(current.request_item.sys_id);
    RITM.comments.setJournalEntry(comments);
    RITM.update();


})(current, previous);

Hope this helps!

If this was helpful or correct, please be kind and click appropriately!

Michael Jones - Proud member of the CloudPires Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

View solution in original post

2 REPLIES 2

Michael Jones -
Giga Sage

With your current configuration I don't see a way to satisfy all of your requirements without sending double the notifications at the RITM level; I also don't see an easy way to make comments at the task level visible via the portal 

Are the notifications at the RITM level for comments really necessary - as in - do these provide value? Are they being updated for work outside of the tasks?

If your primary goals are to make all comments at the RITM level visible in the Portal, and maintain the ability for a user to reply directly to comments at the task level then my best suggestion would be to disable the notification at the the RITM level and drive all comments from tasks. 

You would create a business rule to push all comments placed in a task up to the RITM (which make them visible on the portal) but rely on the notification at the task level to inform the user, and allow for the response to flow back to the appropriate task. 

The business rule would be relatively simple (this assumes you really are using comments on task, not work_notes) 

Table: sc_task

After / Update

Advanced:

(function executeRule(current, previous /*null when async*/ ) {

    var comments = current.comments.getJournalEntry(1);
    var RITM = new GlideRecord('sc_req_item');
    RITM.get(current.request_item.sys_id);
    RITM.comments.setJournalEntry(comments);
    RITM.update();


})(current, previous);

Hope this helps!

If this was helpful or correct, please be kind and click appropriately!

Michael Jones - Proud member of the CloudPires Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

That worked perfectly, thank you.