Notification for Additional comments in Service Catalog task

mariapaskova
Kilo Contributor

Hello,

I'm experiencing an issue with a notification not sent to the task assignment group when a service catalog task is commented.

The Additional Comments section on the Catalog Task, is on   sc_task.request_item.comments

find_real_file.png

When I define the condition for "when to send", I don't see Additional comments in the list under Requested item fields.

find_real_file.png

I try to trigger the event with "Event is fired" instead of Insert/Update and defined a business rule on the requested item table, but it doesn't send the notification as well.

These are screenshots of the business rule, event registry and notification:

Notification:

find_real_file.png

Event registry:

find_real_file.png

Business rule:

find_real_file.png

If someone can help me with this issue will be great.

Thanks a lot in advance!

Maria

1 ACCEPTED SOLUTION

In the script where you trigger the event sc_req_item.commented you can add the following code:



var grpList = [];


var tsk = new GlideRecord('sc_task');


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


tsk.addQuery('active','true');


tsk.query();


while (tsk.next()){


  grpList.push(tsk.assignment_group+'');


}



  gs.eventQueue("sc_req_item.commented",current, grpList.join(','),gs.getUserName());


View solution in original post

24 REPLIES 24

Eureka.JPG


Hi Maria,



one more question, can you see the 'Addition Comments' on catalog task as well?


You can check that by going to catalog task header, personalize form and check whether that field is available to you as well.


Yes, Additional comments is possible to be added in the Catalog task, but we actually want the Additional comments field in the requested item to be replicated in the task.


okay, so can you check if event gets registered now?


Since you are updating RITM as well automatically once TASK is updated.


BR should register an event in event logs


Tanaji Patil
Tera Guru

Hi Maria,



I can see from your screenshots that you are using the business rule and event written on the 'requested Item' table and writing the notification on 'Catalog task' table.



As you said you want to send to the task assignment group when a service catalog task is commented.



Create an event and your notification on 'Catalog Task' table.


Write a BR on after update(can also use insert if you want) on 'Catalog Task' table and in the script use-


if(current.comments.changes()) {


gs.eventQueue("your_event_name",current,gs,getUserID(),gs.getUserName());


}



Now use this event to trigger your notification.



Thanks,


Tanaji


hi Tanaji,



I was thinking the same way you are, but what I observed is, I suspect their additional comments field is added by doing dot walking on catalog task and it is not native to the table itself. If you closely see the screenshot provided by Maria, it will be clear.