How to post additional comment on Record Producer or RITM

giuseppefalcone
Tera Contributor

Hi all, 

this is my use case: the incident/RITM will close automatically at submit sending a notification mail to user who open it.

It's also needed to add a comment and resolution note with the same content of notification.

 

I've got a problem with additional comments: if i wrote

current.comments = "example comments";

i can see the comment, but it's posting this as a user, not as a system. I want to post these comments as a system or as another specific user.

 

I have also tried the below solution, but it didn't work.

current.comments.setJournalEntry('example of comment', 'system');

 

thank you 

1 ACCEPTED SOLUTION

@giuseppefalcone 

 

Tried Filipe's solution. It is working as expected. Refer below screenshots :

 

AmitVerma_0-1715836361964.png

 

AmitVerma_1-1715836373411.png

 

AmitVerma_3-1715836464731.png

 

AmitVerma_2-1715836407444.png

 

In your case, you need to pass the comment dynamically so you can follow below approach. In your Script action, store the event parameter 1 value in a variable and pass it to the comments field.

 

AmitVerma_4-1715837682772.png

 

and while calling the event in your record producer, pass the comment as a parameter as shown below :

AmitVerma_5-1715837771893.png

 

 


Please mark this response as correct and helpful if it assisted you with your question.

View solution in original post

10 REPLIES 10

@giuseppefalcone 

 

You are updating the Journal entry in Business rule, right ? I tried reproducing the issue and every time it shows System only as the user.

 

AmitVerma_0-1715768427706.png

 

AmitVerma_1-1715768488306.png

 


Please mark this response as correct and helpful if it assisted you with your question.

@Amit Verma 

no, i've insert that script in record producer's script field directly. Is it not correct?

@giuseppefalcone 

 

I am able to reproduce the issue with record producer. May be, it's taking the logged in user session only to post the comment. Found an alternative solution on the below link :

https://www.servicenow.com/community/itsm-forum/how-to-input-in-comments-work-notes-journal-field-as...

 

Please give this a try and let me know.


Please mark this response as correct and helpful if it assisted you with your question.

if i try in this way, when i submit the record producer on employee center, my session disconnected and i need to login again, logout (because seems that i impersonate myself) and login again

---

i need to try the solution provided by Filipe Cruz on that topic

 

@giuseppefalcone 

 

Tried Filipe's solution. It is working as expected. Refer below screenshots :

 

AmitVerma_0-1715836361964.png

 

AmitVerma_1-1715836373411.png

 

AmitVerma_3-1715836464731.png

 

AmitVerma_2-1715836407444.png

 

In your case, you need to pass the comment dynamically so you can follow below approach. In your Script action, store the event parameter 1 value in a variable and pass it to the comments field.

 

AmitVerma_4-1715837682772.png

 

and while calling the event in your record producer, pass the comment as a parameter as shown below :

AmitVerma_5-1715837771893.png

 

 


Please mark this response as correct and helpful if it assisted you with your question.