We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Question About field Additional Comments

ItayB
Tera Expert

Hello Guys, 

This is my mission: 

 

"When the customer (requested for) - writes a comment (Additional comment) on the request: the comment will be copied to all open tasks."

 

I tried to use Business Rule but there is what happened:

* The Comment will not seen in the tasks of the RITM. 

* The Comment write twice in the SOW view and in the RITM View.

 

ItayB_0-1751466544307.png

ItayB_1-1751466577648.png

 

 

6 REPLIES 6

Dr Atul G- LNG
Tera Patron

Hi @ItayB 

What’s the business case for showing comments on all item tasks? The comment might not be relevant to every task. Also, when the end user adds a comment, it goes to the RITM—not the tasks—since users only have the option to comment on the RITM from the portal, not individual tasks."

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Masthan Sharif
Kilo Sage

Hi @ItayB,

Hope you're doing well!
Can you try using the below line at line 13 in your script?

  taskGr.comments.setJournalEntry(comment); 

 

Best Regards,

Sharif

Chaitanya ILCR
Giga Patron

Hi @ItayB 

 

update your script as 

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

    var taskGr = new GlideRecord('sc_task');
    taskGr.addEncodedQuery('request_item=' + current.getValue('sys_id') + '^stateIN1,2');
    taskGr.query();

    while (taskGr.next()) {
        taskGr.comments = current.comments;
        taskGr.update();
    }

})(current, previous);

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

Thanks everyone for the comments!


This script fixed this problem:
* The Comment will not seen in the tasks of the RITM. 

but this problem still happening:

* The Comment write twice in the SOW view and in the RITM View.