Skip to main content
Question

Need help to build and express to indexof on description

  • November 14, 2024
  • 2 replies
  • 28 views

Sravanr23
Apprentice

I am looking to build an expression on the description to get a value in a particular place for the ticket if you look at screenshot below we are looking to get country value form the description and route the ticket based out of it 

 

 

 

 

and here is the description

 

Did this topic help you find an answer to your question?

2 replies

DanielRuff
Skilled Expert
Forum|alt.badge.img+7
  • Skilled Expert
  • 72 replies
  • November 15, 2024

I divided a similar use case into three expressions as this was hard to put together in one expression. 

  1.  Search for the place where “country” is within the description: E1, e.g. returning 10
    indexOf('{{ticket.description | sanitize_html | strip_html | escape }}','Country:', 0)
  2. Search for the place where “https” is (E2), e.g. returning 25
    indexOf('{{ticket.description | sanitize_html | strip_html | escape }}','https:', 0)
  3. Add or substract a few numbers to exactly get the start or end of this string. e.g. “Switzerland” is between position 10 and 25 ± a small amount.
    trim(substring('{{ticket.description | sanitize_html | strip_html | escape }}', {{E1.result}}+8, {{E2.result}}))

    Not sure about the exact numbers you have to add or substract as we had this with another use case/strings.


Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14

Looks like a alarm, do you have pro or higher ? 

You could use the alert module and e-mail into that. 


Reply