RITM<>SCTask Comments - Remove Duplicate System Record

appstorm
Tera Contributor

I'm currently working on a BR to send work notes from RITM to SCTask:

 

- "RITM Work Notes to SCTask"

-- Table: sc_req_item

-- After/ Update

-- When Work Notes Changes

 

 

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

	var sctask = new GlideRecord('sc_task');
	sctask.addQuery('request_item', current.sys_id);
	sctask.query();
	while(sctask.next()) {
		sctask.comments = current.work_notes.getJournalEntry(1);
		sctask.update();
	}
})(current, previous);

 

 

It works.

 

- HOWEVER -

 

I get what appears to be both a user AND system update on the RITM Activity Stream:

 

Image 6-11-24 at 10.59 AM.jpeg

How can I remove the "Comment added from" record?

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@appstorm Looks like there is another business rule running which is adding the additional comments as and when a worknotes is added. Please deactivate the business rule and the comment will no longer appear.

I thought the same, but the other only fires when Additional Comments changes.

Jitendra Diwak1
Kilo Sage

Hi @appstorm,

 

Please try this below thread. 

 

https://www.servicenow.com/community/developer-forum/copy-comments-from-ritm-to-task-vice-versa/m-p/... 

 

Please accept my solution if it resolves your issue and thumps 👍 up 

 

Thanks 

Jitendra 

Please accept my solution if it works for and thumps up.