Question

Parse info from a ticket for workflow?

  • 15 June 2023
  • 3 replies
  • 160 views

Badge

Good morning all!
We are working on an offboarding module/workflow and need a little help.
Does anyone know if it’s possible to parse data from a ticket in order to use it as a value in a workflow?
For instance, in the below example our departure notices are always formatted the same. Primarily we are looking on figuring out how to extract the “employee email address field” and then use that later on in the workflow for Azure/AD tasks. I found a great resource earlier, but unfortunately couldn’t replicate that on my end too well (liquid filter to extract information from an email body into fields | Freshworks Community). 
Has anyone had experience or luck with this?
 

Please perform necessary actions in regard of the following employee departure.

Employee email address: Person.mcperson@ccompany.com
Termination date: 08/19/2022
Last day working: 08/19/2022
Job title: Administrative Assistant
Department: Accounting
Work location: 123b
Immediate Departure: No
Forward email to: Manager, Person

3 replies

Userlevel 6
Badge +8

If you can get them to send the request using the service catalog, I would use the Expression Builder. https://support.freshservice.com/en/support/solutions/articles/50000004100-expression-builder-node 

Here is some example code where I needed to parse information from the email address and passed it to the next task in the Automator. Let me know if that is what you were looking for.
 

regexReplace('{{ticket.from_email}}', '@domaintoremove.com','')

 

 

 

Userlevel 7
Badge +13

All fields in the onboard module can be accessed using placeholders. 

The notice isn’t from Freshservice? 

Userlevel 1
Badge +3

Hi @amaevers10 
We pretty much do exactly that, although our input doesn’t have the table formatting that you’ve got (unless that’s just an example?)

I think this expression would give you what you need, assuming that the email address starts as the next character after the colon in “Employee email address:”:

substring('{{ticket.description | strip_html}}',indexOf('{{ticket.description | strip_html}}','Employee email address:', 0)+23, indexOf('{{ticket.description | strip_html}}', "Termination", 0))

Reply