Parse a Number out of an Inbound Email Subject line and Populate a Field

marrerocmm
Tera Contributor

I am trying to parse a ticket number from an integrated system out of an email subject line and populate a custom ticket number field on the incident form with that number. Does anyone know how to do this? Thank you in advance!

7 REPLIES 7

It there a way to do this in flow designer. i have a very similar item been trying to work with in flow

Can you do this for this subject? 

FYI: Termination for John Smith, 603677 (2025-01-10)

 

Trying to pull the name, employee number, and date into separate variables

-O-
Kilo Patron

You could also use RegExp to extract the ticket number:

var subject = 'Service Desk Ticket # [123456] - Created';

gs.debug(getTicketNumberFromSubject(subject));

function getTicketNumberFromSubject (subject) {
	var match = subject.match(/^.*#\s*\[\s*(\d+)\s*\].*$/);
	return match ? match.pop() : '';
}