MS teams is not working is not responding after cloning

ServiceNow10sun
Giga Guru

Hi All , 

 

After the cloning the MS teams chat bot is not responding. After the clone the Client ID and Tenant ID has been cloned from production instance to stag instance  ,which i have corrected and updated as well the stag instance( updated the Client ID and Tenant ID as how it was before the clone) , however still the chat bot is not responding. 

I have even after the update of the Client ID and Tenant ID downloaded the Manifest file and uploaded into the MS teams application but still the chat bot(Virtual agent) is not responding. 

Any suggestions or anyone has faced similar issue. 

ServiceNow10sun_0-1704736362451.png

 

1 ACCEPTED SOLUTION

ServiceNow10sun
Giga Guru

The issue has been resolved.

1. Clean up the cache by running back ground script. 

2. Updating all the Microsoft plugins

3. By reinstalling the Azure apps in ServiceNow.

4. Re authorizing the ServiceNow and MS teams from ServiceNow instance. 

 

FYI - Reason for the issue is while doing upgrade we should exclude all tables related to Azure apps/ MS teams in SN instance. 

 

View solution in original post

7 REPLIES 7

  • @Aaron Duncan 
  • Copy the clean-up script from the attached MSTeams_CleanUpScript.txt file.
  • Paste the clean-up script in background scripts.
  • Edit the clean-up script content and change the value for TeamsProviderAppName to the following:

         var TeamProviderAppName = "Test Vt Teams Adapter";   ===>.  var TeamProviderAppName = "<Copied value from Step 4>";

 

Clean up Back ground script is :

 

// Delete Teams configuration

//Enter Provider Application name for MS Teams

var TeamProviderAppName = "Test Vt Teams Adapter";

 

function deleteTeamsConf(TeamProviderAppName) {

   if (!TeamProviderAppName)

      return;

 

   var providerApp = null;

   var message_auth = null;

 

   // Get the providerApp id

   var gr = new GlideRecord('sys_cs_provider_application');

   gr.addQuery('name', TeamProviderAppName);

   gr.query();

   if (gr.next()) {

      providerApp = gr.getValue('sys_id');

      message_auth = gr.getValue('message_auth');

 

      // Delete the configuration messages

      var ac = new GlideRecord('sys_cs_bot_messages');

      ac.addQuery('sys_cs_provider_application', providerApp);

      ac.query();

      ac.deleteMultiple();

      gs.info("Deleted the messages for provider app");

 

      //assign variables

      var inbound_message_verification = null;

      var outbound_message_creation = null;

 

      //Delete the provider auth record

      var ma = new GlideRecord('message_auth');

      ma.addQuery('sys_id', message_auth);

      ma.query();

      if (ma.next()) {

         inbound_message_verification = ma.getValue('inbound_message_verification');

         outbound_message_creation = ma.getValue('outbound_message_creation');

 

         var oauth_oidc_entity = null;

 

         //Delete the oidc token record

         var otv = new GlideRecord('oidc_token_verification');

         otv.addQuery('sys_id', inbound_message_verification);

         otv.query();

         if (otv.next()) {

            oauth_oidc_entity = otv.getValue('oauth_oidc_entity');

 

            //Delete the oidc entity record

            var ooe = new GlideRecord('oauth_oidc_entity');

            ooe.addQuery('sys_id', oauth_oidc_entity);

            ooe.query();

            if (ooe.next()){

               ooe.deleteRecord();

               gs.info("Deleted the oidc entity record " + oauth_oidc_entity  );

            }

 

            otv.deleteRecord();

            gs.info("Deleted the oidc token record " + inbound_message_verification  );

         }

 

         //Delete the outbound token verification record

         var tv = new GlideRecord('token_verification');

         tv.addQuery('sys_id', outbound_message_creation);

         tv.query();

         if (tv.next()){

            tv.deleteRecord();

            gs.info("Deleted the outbound token verification record " + outbound_message_creation  );

         }

 

         ma.deleteRecord();

         gs.info("delete the message auth " + message_auth  );

      }

   }

   gr.deleteRecord();

   gs.info("delete the provider app " + providerApp);

}

 

deleteTeamsConf(TeamProviderAppName);

Lowell Coleman
Tera Contributor

Can you provide a list of tables to be excluded? Is there a KB on this?

 

Aaron Duncan
Mega Sage

@Lowell Coleman 

Here are the tables I was told to exclude.

 

AaronDuncan_0-1725019981898.png