0

I have built a python process which automates some portion of handling support tickets in Salesforce. I use selenium to extract all open support tickets and stores them in an archive. From that list, I perform a few actions (searching for duplicate account records and searching for additional account information) and save the results into 2 different directories: 1 for non-duplicate account support tickets and another for potential duplicate records. And for each of these directories, I process them further and I store the results in yet another pair of directories.

Here is an example of my directory structure:

TicketProcessor
|-- ticket_archive
|   |-- all_tickets_06_17_2019.pkl
|   |-- all_tickets_06_18_2019.pkl
|   |-- all_tickets_06_19_2019.pkl
|   `-- all_tickets_06_20_2019.pkl
|-- non_duplicates
|   |-- approved
|   |   |-- processed_06_20_2019.pkl
|   |   |-- processed_06_21_2019.pkl
|   |   `-- processed_06_22_2019.pkl
|   |-- failures
|   |   |-- failed_06_20_2019.pkl
|   |   `-- failed_06_22_2019.pkl
|   `-- unprocessed
|       |-- staged_for_approval_06_19_2019.pkl
|       `-- staged_for_approval_06_21_2019.pkl
`-- potential_duplicates
    |-- potential_duplicates_06_20_2019.pkl
    |-- potential_duplicates_06_21_2019.pkl
    `-- potential_duplicates_06_22_2019.pkl

I want to know if there are some software paradigms for maintaining these ever-growing directories to identify the current state of and which subset of the data needs processing.

My approach so far is to build a class TotalTicketScanner where I simply extract all of the support numbers (the unique ID for each support ticket) and create a set for each of the directories of the support numbers. I then make sure that any new ticket entering this pipeline is not in any of these sets so that I don't duplicate my efforts.

I figured that this issue is not unique and I would appreciate anyone pointing me to any information regarding problems like this

Thank you so much!

edit for additional information

The objects in each directory are different flavors of objects I have created. In the ticket archive, I have dataframes which are essentially tables where each supprort ticket is a row on the table.

To analyze each support ticket, I use an Account class and a Support class as well as an additional class specific to my organization that designates a relationship between accounts. Each of these classes have methods to extract different pieces of information not listed on the original support ticket as well as methods to interact with the support ticket (eg. close the ticket, assign the support owner, and changing the support rep) and the general SalesForce functionality (eg utilizing the search functionality, extracting the search results, changing account ownership, and extracting account information).

When I process a ticket, I create these classes for each ticket. When I store the non-duplicates, I store a list of dictionaries containing the dict representation of the class like so:

[{'support': Support.__dict__, 'account': Account.__dict__}, ...]

As I continue to process these lists of dicts, I add more dictionary representations of additional classes.

The net result of all my processing is additional modification to the original ticket, the creation of a few class objects used in analyzing the tickets, and storing the dictionary representation of each class object.

It seems as though the response below given by @candied_orange is a solid solution for maintaining the state for which tickets are worked or unworked. I don't know if I am over complicating things. I am more interested in learning if there are any programming paradigms for maintaining data distributed through a project at various states of processing.

Thanks again!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.