The CreatorCon Call for Content is officially open! Get started here.

Copy work notes/Additional comments from Incident to Incident task and vice versa

Indira8
Kilo Sage

Hi All, 

We have a requirement to copy worknnotes from Inc Task to Inc and also copy the Worknotes and Additional comments from the Incident to the Additional comments of the Incident Task. However, when tried on personal instance , there are redundant entries being populated on task as shown below: 

find_real_file.png

Is there any filter that we can apply in the Business rule script that is the comment is copied from TASK then it should not be copied again. 

 

There are currently 2 BRs running for copying comments from INC -> TASK :

 

find_real_file.png

 

Could you please help with scripting solution for this issue 

Thank you 

1 ACCEPTED SOLUTION

Voona Rohila
Mega Patron
Mega Patron

Hi indira

You need to add additional condition in BR to prevent it from copying recursively.

current.comments.indexOf('Worknotes added from incident') < 0;

check this article https://community.servicenow.com/community?id=community_article&sys_id=4750aecfdbf3d814fa192183ca961...

 

You don't need 2 BR's for worknotes & comments , you can use current.work_notes.changes() or current.comments.changes() in your single BR.

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

7 REPLIES 7

It is still not working with this condition 

Anil Lande
Kilo Patron

Hi,

You can use inc.setWorkflow(false); to avoid running any BR's on incident when comments are added by your code.

Note: If you have any logic on Comments Updated  to send email etc, then that will not work for these copied comments/worknotes.

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hi @Anil Lande  yes , we have to send out notifications so I think we should think of a different workaround

thank you