Routing Rules Intro & Common Errors in versaSRS

Routing Rules

Routing Rules allow an Administrator to define special criteria which governs what happens to incoming email messages that match this criteria. These can be used to automatically log any common, frequently occurring incidents or requests with the necessary Team (and User) who can resolve the Case. For example a Routing Rule could be created that dictates all incoming messages with 'Support' in the email Subject get logged with the Support Team.

Common Errors

Click one of the below listings to jump to the relevant section

versaSRS displaying oddly

Any display issues for Users, especially after updating versaSRS or if the machine in use is a shared device, have the User clear browser cookies and cache.

If the User has done this and the screen is still displaying as blank (example pictured above) check the Configuration section of the User's Profile and confirm any JSON pairs are separated by a comma (,). To view the set customisation(s) for the User run the below query replacing UsersEmail with the email assigned to the Users profile, click the returned row to display this data in a separate window, scroll to the very bottom to find the Configuration data (example pictured).

SELECT Customisation FROM tbl_Users
WHERE Email LIKE 'UsersEmail'


Cases in Read Only

The User doesn't have the necessary Security Profile assigned. Confirm that the User has a Security Profile assigned for that Team and that profile allows access to the Manage the Case. Run the below query to confirm the security profile(s) assigned to the User, replace the value UsersEmail with the relevant email address in the User's profile. The Can Manage Cases field should display a 1, if it does not the Cases being in Read Only is expected.

SELECT tbl_Queues.QueueName AS 'Team', ProfileName AS 'Security Profile', ManageCalls AS 'Can Manage Cases'
FROM tbl_QueueUsers
INNER JOIN tbl_Queues ON tbl_QueueUsers.QueueID = tbl_Queues.QueueID AND QueueStatus = 1
INNER JOIN tbl_SecurityProfiles ON tbl_SecurityProfiles.SecProfileID = tbl_QueueUsers.SecProfileID
WHERE tbl_QueueUsers.UserID = ( SELECT UserID FROM tbl_Users WHERE Email LIKE 'UsersEmail' )
ORDER BY QueueName

User can't be assigned Cases within a particular Team

The User doesn't have the necessary Skill Group(s) assigned. Check the User has been assigned the relevant Skill Group(s) for the Team. Run the below query to confirm the Skill Group(s) assigned to the User, replace the value UsersEmail with the relevant email address in the User's profile.

SELECT tbl_Queues.QueueName AS 'Team', GroupName AS 'Skill Group'
FROM tbl_QueueGroupUsers
INNER JOIN tbl_Queues ON tbl_QueueGroupUsers.QueueID = tbl_Queues.QueueID AND QueueStatus = 1
INNER JOIN tbl_Groups ON tbl_QueueGroupUsers.GroupID = tbl_Groups.GroupID
WHERE tbl_QueueGroupUsers.UserID = ( SELECT UserID FROM tbl_Users WHERE Email LIKE 'UsersEmail' )
ORDER BY QueueName

Argument 'Start' error

An error message appears that reads "Argument 'Start' must be greater than zero." when closing a Case and the 'Send Closed confirmation' checkbox is ticked.

The cause of this is the Global Setting versaSurveyURL doesn't match the versaSurvey URL specified in the Closed Confirmation Template for the Team. Use the below query to confirm the correct versaSurveyURL value.

SELECT Value1 FROM tbl_ApplicationSettings
WHERE Name LIKE 'versaSurveyURL'

Run the below query to return the raw HTML data for the Closed confirmation Template. You will need to confirm with the User that reported this issue what the Case ID of the affected Case was and swap the value CaseID with the ID provided.

SELECT QueueName AS 'Team', Body AS 'Template'
FROM tbl_QueueNotificationTemplates
LEFT JOIN tbl_Queues ON tbl_QueueNotificationTemplates.QueueID = tbl_Queues.QueueID AND QueueStatus = 1
WHERE ( RecordTypeID = 1 AND TemplateID = 2 )
AND tbl_Queues.QueueID = ( SELECT QueueID FROM tbl_Calls WHERE CallID = CaseID )

To render the HTML, create a new notepad file and copy-paste the data in there, select the save button and in the resulting window change the 'Save as type:' drop-down to "All Files". Give the template a relevant file name and ensure the name ends in '.html'.

Once this file is saved open it and it should display the rendered HTML in the browser, confirm the survey URL is incorrect then inform the relevant Administrator to update the Template with the correct URL (ensure you provide the URL and Team name).


Divide by zero

When a User views a particular Team or is in the My Cases view (pictured) there are no Case listings displayed, and there is an error message that reads "An exception occurred while retrieving the records. Source: .Net SqlClient Data Provider Error: Divide by zero error encountered." This happens when a Case's Due Date has been set to be before the date the Case was created.

There are several queries you can run to diagnose this issue, however some discretion is required to determine the best one to run and how to resolve the situation.

The first query is a basic query to return the 10 most recently logged current Cases that have a due date earlier than the logged date, it is very likely this will return Cases that are not currently the direct cause of the issue.
NOTE: If desired you can change the 10 to a higher value; the query is limited to return the top 10 in the rare instance there are a large number of Cases matching this criteria we limit the dataset to ensure we don't cause performance issues for versaSRS.

SELECT TOP 10 CallID AS 'Case ID', DateEntered AS 'Logged Date', DueDate, Subject
FROM tbl_Calls
WHERE DateEntered >= DueDate
AND CallStatusID IN (1,2,4,7)
ORDER BY DateEntered DESC

The second query is best to run if this is being experienced in the My Cases view, change the UserEmail value to the relevant email address, this will return all Cases with an illogical due date assigned to the affected User.

SELECT TOP 10 CallID AS 'Case ID', DateEntered AS 'Logged Date', DueDate, Subject
FROM tbl_Calls
WHERE DateEntered >= DueDate
AND CallStatusID IN (1,2,4,7) AND UserID IN (SELECT UserID FROM tbl_Users WHERE Email LIKE 'UsersEmail' )
ORDER BY DateEntered DESC

The final query is best to run if this is occurring when viewing a particular Team, ensure you replace the Team Name value with the correct Team name (including any spaces).

SELECT TOP 10 CallID AS 'Case ID', DateEntered AS 'Logged Date', DueDate, Subject
FROM tbl_Calls
WHERE DateEntered >= DueDate
AND CallStatusID IN (1,2,4,7) AND QueueID IN (SELECT QueueID FROM tbl_Queues WHERE QueueName LIKE 'Team Name' )
ORDER BY DateEntered DESC

Once you have identified the impacted Cases you can run the below UPDATE statement to set the due date to be 2 days from when they were logged, and resolve the error occurring.
Depending on how your business operates there will likely be SLA's for certain requests, if any of these Cases match that criteria they may require a specific due date that you will need to confirm with the business. Replace the bold part of the statement with the query you ran, ensure you remove everything between the words CallID and FROM, or replace it with the returned Case ID value(s).
If you are unsure about any of these steps to update the due date do not proceed with the update statement. Contact the DBA or VersaDev Support Staff.

UPDATE tbl_Calls
SET DueDate = (DATEADD(DAY,2,DateEntered))
WHERE CallID IN (
SELECT TOP 10 CallID
FROM tbl_Calls
WHERE DateEntered >= DueDate
AND CallStatusID IN (1,2,4,7)
ORDER BY DateEntered DESC

)

If you wish to change the time range for the Due Date you can change the first two values in the DATEADD() function, i.e the below example will set it to 5 hours after the Logged Date timestamp.

(DATEADD(HOUR,5,DateEntered))