Adding RITM comments and work notes to the sc_task form activities stream

nicholar
Kilo Contributor

Does anyone know if it is possible to add the comments from the RITM of a task to the task's activites (filtered) stream?

I've been playing around with this and can't seem to get the comments to appear within the activities stream.

I've tried adding the request_item.work_notes, comments, etc. to the glide.ui.sc_task.activity.fields.

find_real_file.png

but when I add request_item comments_and_work_notes to the task form view this is how they appear:

find_real_file.png

The fields to post to the ritm comments or work notes appear to get fed through the activities formatter but the comments and work notes themselves don't seem to and I'm not sure why.

Any help or guidence is greatly appreciated.

1 ACCEPTED SOLUTION

amlanpal
Kilo Sage

Hi Anthony,



Please write a before Update Business rule in the Requested Item (sc_req_item) table with the conditions and script as below:


Table: Requested Item (sc_req_item)


When: before


Update: Checked


Advance: Checked


Filter conditions: Work notes changes


Script:


  var gr = new GlideRecord('sc_task');


  gr.addQuery('request_item',current.sys_id);


  gr.query();


  if(gr.next())


  {


  //It will update the Catalog task's Work notes with the Requested item's Customer Communication


  gr.work_notes= "The following Work notes have been added :\n " + current.comments;


  }



Once you are done with the above Business rule, just make sure that the 'glide.ui.sc_task_activity.fields' system property should have 'work_notes' in its value.



I hope this helps.Please mark correct/helpful based on impact


View solution in original post

12 REPLIES 12

nicholar
Kilo Contributor

For clarity I'd like the request item comments to appear like the task comments do in the activity stream:



find_real_file.png


amlanpal
Kilo Sage

Hi Anthony,



Please write a before Update Business rule in the Requested Item (sc_req_item) table with the conditions and script as below:


Table: Requested Item (sc_req_item)


When: before


Update: Checked


Advance: Checked


Filter conditions: Work notes changes


Script:


  var gr = new GlideRecord('sc_task');


  gr.addQuery('request_item',current.sys_id);


  gr.query();


  if(gr.next())


  {


  //It will update the Catalog task's Work notes with the Requested item's Customer Communication


  gr.work_notes= "The following Work notes have been added :\n " + current.comments;


  }



Once you are done with the above Business rule, just make sure that the 'glide.ui.sc_task_activity.fields' system property should have 'work_notes' in its value.



I hope this helps.Please mark correct/helpful based on impact


Hi nicholar,



Did you able to check the solution I provided in my last response? If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.


If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View


Hi Amlan Pal,



Your solution is not quite what we were looking to do. I don't want to copy comment/work notes to the task record, instead just display them in the activities stream on the task (if that makes sense).



find_real_file.png



I'd imagine there would be a way to make request_item.comments show up in the available section above. Correct me if I'm wrong.