Hi
I need some help with the following issue.
I try to extract an user e-mail address from a ticket description so I can use that data to update the ticket requestor in FS.
In my workflow I have an API call defined to retrieve the ticket information, then use the JSON parses to define the outputs and using below output in my expression builder.
"description_text": "Tue Aug 02 10:10:39 2022: Request 224889 was acted upon.\r\n\r\n Transaction: Status changed from 'open' to 'resolved' by aaaaa\r\n Actor Email: aaaaa@bbb.net\r\n Queue: cccc\r\n Subject: #INC-100853] Test 5 - July 21\r\n Owner: Nobody\r\n Requestors: helpdesk@xxx.freshservice.com\r\n Status: resolved\r\n Priority: 0\r\n Ticket <URL: https://tickets.bbb.net/Ticket/D9 >\r\n\r\n\r\nThis transaction appears to have no content\r\n",
I try to extract the mail address that comes after Requestors: and before Status: running below expression
substring('{{ticket.description_text | sanitize_html}}',indexOf('{{ticket.description_text | sanitize_html}}', 'Requestors:',0)+length('Requestors:'), indexOf('{{ticket.description_text | sanitize_html}}', Status', indexOf('{{ticket.description_text | sanitize_html}}', 'Requestors:',0)) )
The result is “helpdesk@xxx.freshservice.com\\r\\n”
I’m stuck with the “\r\n” and have no clue how to remove this for the result using the expression builder?
Does anyone has an idea how to do this?