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.