Pre populate SR fields from chats or phone calls

Here's a list of field that come pre populated in SR forms:

Pre populated fields

Field Value Source
Title SVC_MCA_INTRACTION_DESCRIPTION
Problem description Summary
Product engagementData > Product ID
Category engagementData > Category ID
Channel Type Code INTERACTION_TYPE

How to pre populate SR field from a phone call or chat

  1. In VB Studio, choose svc-contact from App UIs list, then Service Center > Service > ec > sr > svc-contact.
  2. Click the Event Listeners tab, and then click + Event Listener.
  3. From the list of events, choose OpenCreateServiceRequest, and click Next.

    This event will be fired when the agent initiates the create SR action.

  4. From the Action Chains list, select Get Engagement Data to retrieve the engagement data.
  5. Pass $base.variables.uefContext to first argument (uefContext).

    Now we need to set the SR field values from the engagement data we retrieved from the previous step,

  6. Use a global function with the label Set Fields Value from the CX Service list.

    The method expects following arguments. from the Fields And Value List, we'll construct an Array like the following:

    [
      {
        fieldName: 'ServiceRequest.Title',
        value: callGetEngagementDataByUefPageContext.inData.my_text_customfield,
      },
    ]
    
    uefContext: we will pass the drawers uef context which is available as $base.variables.drawerObjectUefContext

    And here's a sample action chain from this implementation:

    define([
      'vb/action/actionChain',
      'vb/action/actions',
      'vb/action/actionUtils',
    ], (
      ActionChain,
      Actions,
      ActionUtils
    ) => {
      'use strict';
     
      class openCreateServiceRequestListener extends ActionChain {
     
        /**
         * @param {Object} context
         * @return {{stopPropagation:boolean}}
         */
        async run(context) {
          const { $page, $flow, $application, $base, $extension, $constants, $variables, $modules } = context;
     
          const callGetEngagementDataByUefPageContext = await $modules.mcaUtils.getEngagementDataByUefPageContext($base.variables.uefContext);
     
          const callSetFieldsValue = $modules.uiEventsFramework.setFieldsValue([{
              fieldName: 'ServiceRequest.Title',
              value: callGetEngagementDataByUefPageContext.inData.my_text_customfield,
            }], $base.variables.drawerObjectUefContext, false);
     
          return { stopPropagation: false };
        }
      }
     
      return openCreateServiceRequestListener;
    });