Processing Voice Mails into Autotask, pt 2: Create ticket by Account Number (not Contact)

This thread from November was helpful; mimicing this I am able to extract caller phone number from the subject line, search contacts, and create a ticket based on the first contact found.

The rule looks like this:

  1. Extract phone number from email subject via RegEx. :white_check_mark:
  2. Search Autotask Contacts for the phone number, pick first ascending, store in custom.Contact :white_check_mark:
  3. Create Autotask Ticket based on custom.Contact.[0].EMailAddress using “Create Autotask Ticket (emails from People)”. :white_check_mark:

What I need instead but haven’t figured out:

  1. Extract phone number from email subject via RegEx.:white_check_mark:
  2. Search Autotask Accounts for the phone number, pick first ascending, store in custom.Account :white_check_mark:
  3. Creat Autotask Ticket based on custom.Account rather than email :x: <-Can’t find a function to accomplish this.
  4. If no custom.Account is found, move on to creating a ticket by Contact as described previously.

The problem is for many Contacts, their default phone number seems to be auto filled with the Account’s phone number. This causes incoming calls from the main line to be attributed to incorrect users; attributing the phone calls no Contact at all would be preferable.

Watching kind of unrelated tutorials, I see now that instead of using the pre-defined “create ticket” actions I can use the API: Create an Object, where the Object type is Ticket. Getting to work on that now.

The process I’ve come up with so far:

  1. Extract phone number from ticket
    (String Functions/Perform a Regular Expression Match)
  2. Check for Autotask Account
    (Autotask Direct API Calls/API: Query for one object)
  3. Create Ticket for Autotask Account
    (Autotask Direct API Calls/API: Create an object)
  4. Attach Voicemail to Ticket
    (Autotask Workflows (emails from people)/Update Existing Autotask Ticket)
    (Autotask Direct API Calls/API: Create Autotask Attachments)
  5. Check for Autotask Contact
    (Autotask Direct API Calls/API: Query for one object)
  6. Create Ticket for existing contact
    (Autotask Workflows (emails from people)/Create Autotask Ticket)

Steps 5 & 6 only run if my stored variable result from Step 2 returns as null.

This seems to work well enough and I haven’t been able to break it yet in my limited testing.

@jcombel

Thanks for posting the follow up! It seems you are on the right track. Let us know if you get stuck and need more help.

Also, I want to confirm that you’re correct to use the “API” steps instead of the “Create Autotask Ticket” workflow step. The latter performs a few Autotask API calls to try to determine the correct contact and account based on the sender’s email address. Since your workflow already determined the correct account based on the phone number, it would be redundant for MSPintegrations to try (again) to identify the correct account. Using the “API” steps avoid that redundancy.

1 Like

Ah, thanks. Looking at my Step 4 (posted at the same time as you), is there a more graceful way to use an API Call to attach the voicemail, rather than the Workflow I chose to use? I’m investigating now but don’t want to stray too far from my working product.

Yep, you can use “API: Create Autotask Attachments”:

Note there is a bug in the UI on this step. You will need to type a number and then delete it from both the “Parent Type” and “Publish” fields so the lock/unlock button becomes active.

Ah, I had moved on from that because I missed the important subtext in the dropdown: “for each email attachment.” Was then distracted by not liking the idea of the .eml checkbox, and so I moved on.

Works. Very cool.