Servicebridge Additonal Commanets

Vinay49
Tera Expert

 

In our system, when a case is created in the provider instance, a corresponding incident is generated in the consumer instance via RTD. During this process, additional comments from the case in the provider instance are automatically synchronized to the remote task. These comments are then reflected in the remote task of the consumer instance and subsequently in the incident.(till this is fine).
When the case is updated with comments by either an agent or a partner, the additional comments are added always by the ServiceBridge user  on the incident.

Requirement is : Commnets should say that which are added by agent/partner on incident

To ensure clarity regarding the origin of the case comments, it is important to specify whether they were added by an agent or a partner. 

To identify the origin of the updates, we can examine the "User" table. By reviewing the "Class" field, we can determine the user type: if the class is "contact," the user is a partner; if the class is "user," the user is an agent. This information will be used to indicate in the comments whether the updates were made by a partner or an agent.


I have written this  before BR on sys_journal_field table, howver not working.
Condition: Name is Tablename(Case) & Element is comments

 

var grUser = new GlideRecord('sys_user');
grUser.addQuery('user_name',current.sys_created_by);
grUser.query();
if(grUser.next())
{
    if(grUser.sys_class_name == "customer_contact")
    {
        current.value = "Partner:"+'\n\n'+current.value;
    }
    else{
        current.value = "Agent:"+'\n\n'+current.value;
    }
}



Your help would be really appreciated. thanks in advance.




2 REPLIES 2

Shivalika
Mega Sage

Hello @Vinay49 

 

Is the comments stored in VALUE field ? 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Comment are stored in value field in sys journal table.

 

when we are adding comments on case, same has been added to the comments on remote task & record will be created on sys journal table.