Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I parse email from JSM integration

Steven Grossman November 7, 2024

Hello,

I have an email integration that create alerts within my project in JSM.  The data is sent in a table type format and in value pairs within the body of the email.  I can successfully filter on text within the body by doing the below within the Create Alert.

Create Alert

      IF message RegEx-contains   .*(Critical|Error|Down).*  

      THEN create alert

This works...  Yeah!

Now, I would like to parse the same email to modify the Alert Message (subject) to include information that is within the body of the message.  Here is an example....

Consolidated Alarms
Report Creation Date/Time: 2024-11-06 T0 4:16:00-07:00 immediate
Total Alarms/Events: 16

 

I would like to add to the number from the value pair - Total Alarms/Events.

In alert properties, I would like to add something to Alert Message like

{{subject}} + message.extract(/Total Alarms/Events: ([1-9]\d?)/, 1))

 

I figured this out too....  sorry no help needed.

{{ message.extract(/.*Events Count: (\d+)/) }}

This worked and it pulled the number 16 from body of email for my subject...  worked.

 

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events