Ability To Remove Deleted Cases From Business Insights
Last Updated -
OverviewWe've heard that a lot of our customers want to remove deleted cases from Business Insight reports. While there is no product feature to achieve that at this point, we have found a workaround that can help you exclude deleted cases from reports. And it's easy!
The idea is to add a “Deleted” label to all the deleted cases and exclude the cases with “Deleted” label in your reports. But case rules won't run on deleted cases to append labels, we will have to work with our API to update the case label.
(Note: this will only work if the case is not permanently deleted. )
RequirementsThis script is written in Ruby and requires at least version 2.1.2, or above. To check which version of Ruby you have installed, simply run
ruby--versionin a terminal.
If you have an older version installed, it's very easy to upgrade and manage different versions with the Ruby Version Manager (RVM). Please see the RVM website for installation instructions.
Note: Using RVM to manage your Ruby installations is highly recommended.
- Download the sample code (see attachment)
- Navigate to the folder in a terminal and run these commands:
gem install bundler
- Edit update deleted_cases.rb to include your credentials
Now run the following:
ruby update deleted_cases.rb
You will see a progress bar while this is running. If there is any error, open the error.log
You are done! Once the script is completed, all the deleted cases will have “Deleted” label and you can now filter out these cases by filtering labels in Business Insights.