ServiceNow Email Body

Good Morning,

So I am currently developing an integration between ServiceNow & PagerDuty, our ServiceNow instance is over 9 years old and heavily customized so its been quite the challenge but I am almost there.

One of the last remaining pieces is regarding the description field which is not currently populating in ServiceNow.

I have been through this article which was pretty helpful:

I created a new inbound field rule and used log_entries.channel.details as the webhook, now this does work if you log a PagerDuty incident manually but not if you email the instance which is what we want as we have third party monitoring tools in place.

I tried using log_entries.channel.body but this returns not only the description\body of the email but also all the HMTL code as well.

Has anyone else got this working?

Kind Regards

Bored Panda

Hi Ashley,

When it comes to HTML we always send exactly what we receive via webhooks. In this case as the email was HTML-formatted, that is what we passed in the webhook and we don’t have any way to alter this via PagerDuty I am afraid!

You could take a second could look at the service that is sending the emails to PagerDuty and see if there is a plain text option.

Hope this helps!

John

Good Morning,

Thank you for the reply,

I tried sending it as plain text but its still bringing over the html:

PagerDuty Webhook Payload Field: “log_entries.channel.body” looking at the description field in SNow:

Results:

In Pagerduty is there no way of coping the Body field into the Details field when an incident is logged?

That way I can just use “log_entries.channel.details”

Kind Regards

Bored Panda

Hi Ashley, hope you’re well!

You should be able to Open and resolve incidents based on custom rules to create a custom rule within your email integration. You can then optionally create custom fields found in the same custom rule which can be extracted from the email body.

This should help you in transferring the data to ServiceNow without the HTML.

Cheers,

Good Morning,

Thank you for the reply, so what I did in the end was to write a custom Regular Expression which stripped out all the html before it is inserted into the field, only took 3 lines of code so it was the cleanest solution for me, I could use it else where then in other inbound field rules to capture other bits of information I needed like Caller, Location etc to populate other fields on trigger.

Thanks for all the advice.

Kind Regards

Bored Panda

Great, Ashley - thanks for clarifying you’re all set!

John

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.