Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

HTML in description field of OpsGenie alerts

Edited

Hi,

I have an issue with the "Description" field of the OpsGenie Alert coming from an Email integration. The email I receive looks like this in HTML:

Screenshot 2022-04-01 at 14.37.45.png

But the description of my generated alert is in one line with no proper spaces and line breaks. Is there anything I can do to fix this?

Screenshot 2022-04-01 at 13.14.54.png

I know that there is the html version in attachments, but I would like to add some extra properties and tags based on the content of the mail. The fact that it comes all in one line is causing some troubles with that and thus my question. Also what is strange, this was working properly some months ago and then all of sudden the alerts started to arrive as oneliners without a change to the email format. What could be the reason for that? 

3 answers

1 accepted

0 votes
Answer accepted
Tom Russell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 01, 2022

@Michał Kłokowski we deal with similar inbound emails from some of our monitoring systems. We usually don't just pass the message through to the Description field, but use multiple 'message.extract' statements, with regexes, to parse out the relevant information. (Loads and loads of message.extract, sometimes, unfortunately). This should work whether the message comes in as a single line or multiple lines, though finding field-end boundaries might be more difficult with a single-line message.

Thank you for the reply. We implemented a similar solution now by using the extract method and adding some self defined delimiters into the mails' content.

Like # people like this
Koponkin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Jul 03, 2023 • edited

@Michał Kłokowski Could you please share an example of your regex. I have the same problem but can't choose the right regex to extract my data. Not sure about the structure of {{ message }} if it's pure HTML or a string with some lines.

Hi @Koponkin ,

In our case, we put custom tags in our alert bodies like this:


MY_TAG_APP: app-name
MY_TAG_ENV: preprod
MY_TAG_MESSAGE: this is a message
MY_TAG_END


 

Then in the OpsGenie integration, we use the following regex to extract the information and add them to the correct fields:


{{message.extract(/(?s)(?<=MY_TAG_APP:).+?(?=MY_TAG)/)}}


So basically we extract what is between "MY_TAG_APP" and "MY_TAG" (start of next tag) 

Hope this helps!

0 votes
Dennis Sheen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Aug 11, 2023

Just a note for others.  if you just want the whole body of the message (i.e. you don't want to parse out everything) and effectively just need line return chars to render properly you can just surround most text with pre tags.

e.g. 

<pre>
line 1
line 2
line 3
</pre>
will likely render good enough for most purposes.

we need to see user<->freshdesk <->opsgenie interaction and all messages are broken because they are wrapped by html in slack and they a looks terrible!!!!

 

TRY TO FIND TEXT within all that HTML GARBAGE around, could you only imagine.....

I found one more complaint https://jira.atlassian.com/browse/OPSGENIE-227 and ETA??? it is so ANNOYING as CAPS and more

please help Team, we count on your understanding!

much appreciated

 

ps

I've found a task  on this matter& hope you will include it into the upcoming "spring" https://jira.atlassian.com/browse/OPSGENIE-227

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events