How to update the workspace related OOB UI action should be work in native UI also

nagaklv
Tera Contributor

Hello Community experts,

 

We are trying to create a Case, Request, and Incident from the Interaction record through CSM Workspace, and they are being created successfully without any issues — because these UI Actions are configured OOB (Out of the Box) for Workspace use.

Now, we are planning to utilize the same UI Actions in the Standard UI. For that purpose, we have enabled the three form buttons:

  • Create Case – The Case record is getting created in the native UI, but it is not being mapped under the Related Tasks related list.

  • Create Incident – The Incident record is also created in the native UI, but again, it is not reflected under Related Tasks.

  • Create Request – The button itself is not working in the native UI.

Can someone help us fix these issues?

 

Thanks,

Nagesh

12 REPLIES 12

Ankur Bawiskar
Tera Patron
Tera Patron

@nagaklv 

so those OOTB workspace UI actions are working fine.

For native those are not working?

What script is written in each of those? whenever you create case, request, incident from interaction a record is created into "interaction_related_record" table

what is that related list point to? which table?

AnkurBawiskar_0-1750244510849.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks for the response. Please find the details below:

  • Create Incident: We checked the Form Button option for the OOB UI Action, and it is now working correctly in the Standard UI as well. The relationship mapping is also working as expected — we just verified it.

  • Create Case: We added the highlighted code (below), but it is still not working. The rest of the logic remains the OOB implementation.

 

current.update();

var newRecord = new GlideRecord("sn_customerservice_case");
newRecord.initialize();

if (!gs.nil(current.account))
    newRecord.setValue("account", current.getValue("account"));

if (!gs.nil(current.contact))
    newRecord.setValue("contact", current.getValue("contact"));

if (!gs.nil(current.consumer))
    newRecord.setValue("consumer", current.getValue("consumer"));

if (!gs.nil(current.short_description))
    newRecord.setValue("short_description", current.getValue("short_description"));

if (!gs.nil(current.opened_for))
    newRecord.setValue("internal_user", current.getValue("opened_for"));

if (GlidePluginManager.isActive('com.snc.service_organization') && !gs.nil(current.req_service_org))
    newRecord.setValue("requesting_service_organization", current.getValue("req_service_org"));

if (GlidePluginManager.isActive('com.snc.csm_proxy_contacts') &&
    !gs.nil(current.opened_for) &&
    current.opened_for.sys_class_name == "sys_user" &&
    new sn_csm_proxy_cont.ProxyContactHelper().isUserProxyContact(current.getValue("opened_for")))
    newRecord.setValue("internal_contact", current.getValue("opened_for"));

if (current.getValue('type') == 'phone')
    newRecord.setValue('contact_type', 'phone');
if (current.getValue('type') == 'chat')
    newRecord.setValue('contact_type', 'chat');

if (GlidePluginManager.isActive("sn_csm_gen_ai")) {
    newRecord.insert();
}

 
if (newRecord.isValidRecord()) {
    var interactionRelatedGR = new GlideRecord("interaction_related_record");
    interactionRelatedGR.initialize();
    interactionRelatedGR.interaction = current.sys_id;
    interactionRelatedGR.document_table = 'sn_customerservice_case';
    interactionRelatedGR.document_id = newRecord.getUniqueValue();
    interactionRelatedGR.insert();
}

action.openGlideRecord(newRecord);

 
var csmWorkspaceUAUtil = new sn_csm_workspace.CSMWorkspaceUAUtil();
csmWorkspaceUAUtil.createCaseClickInteraction();

var intRelUtil = new global.InteractionRelationshipUtil();
if (intRelUtil.copyAttachments !== undefined)
    intRelUtil.copyAttachments(current, newRecord);

@nagaklv 

is it not entering in IF for "Create Case" button?

did you add logs and see?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar Yes it's not printing any logs after if condition