Showing results for 
Search instead for 
Did you mean: 
Walkthrough Wednesdays
Mohammed Farhan

How to update an email contact's extension fields upon requeue request? (UPDATED)

I'm trying to update the extension fields (eg. emailReplyCc) of an email contact inside finesse and make it show on CUIC reports.

I'm invoking the "cisco-ms-rest-module.js" functions: updateContact(), getContact(), updateContactStatus() and requeueContact(), which belong to the following script file:

What I've accomplished so far is:

I've got only one contact pushed to the Mail-CSQ of a certain user.

When that contact is accepted by the user, the following steps are executed:

  1. var dataId = 123;
    var contactUpdateData = {
    extensionFields: {
    emailReplyTo: contact.title,
    emailReplyCc: dataId
    statusTimestamp: contact.statusTimestamp,
    statusReason: "unknown",
    if (contact.status != "reserved") {
    contactUpdateData.status = "reserved";
    $restService.updateContact(contact, authToken, contactUpdateData, successCallback, failureCallback);
    to update the contact's extensionFields to the new ones, status reason to "unknown" and the status to "reserved" only when it's not so already. Then
    getContact(scRefUrl, authToken, successCallback, failureCallback);
  2. Upon user action, either:
    (2_1): Call
    $restService.updateContactStatus(contact, authToken, "handled", "email_agent_replied",
    null, successCallback, failureCallback);
    to update status to "handled" with reason "email_agent_replied" and exit.
    (2_2): Or call
    $restService.requeueContact(contact, authToken, feedTag, null, successCallBack, failureCallBack);
    to put that contact back to the same 'Mail-CSQ' with reason "email_requeue_trasfer" and repeat over the same execution cycle, i.e. continue executing from step (1).
    Invoking any of the two, either (2_1) or (2_2), should add a new record to db_cra.textcustomerdetails, if one doesn't exist already.

Now, the steps above update the contact just fine in the SocialMiner, however in the UCCX db_cra.textcustomerdetails database table the following undesired behavior is observed:

  1. If the execution flow is (1, 2_1) then all steps work fine and the records are updated as required with a new record being added to the db_cra.textcustomerdetails table with the updated extensionFields.
  2. If the execution flow is (1, 2_2 ... ), then the extensionFields are not updated at all in the records, i.e a new record is added but with the original (non-updated) extensionFields.
  3. The INSERTed db_cra.textcustomerdetails record does NOT get updated at all, it is only inserted once, and that's it.


There is a similar action to step (2_2), this one gets executed by the system automatically. When the agent who is currently busy with the contact gets disconnected from the finesse session, the system requeues the contact to the same CSQ with a status reason "email_requeue_agent_disconnected". This has the same and exact behavior as step (2_2) described above, except that it happens automatically.

My question is:
How to always update the extensionFields in the db_cra.textcustomerdetails database table?
Which script file invokes this INSERT command or where does this update request is invoked?

My UCCX and SocialMiner versions are both 11.6(1)


Mohammed Farhan
Software Developer

Content for Community-Ad

This widget could not be displayed.