Custom Field Mapping from Pagerduty to servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 02:31 AM
Hi,
We integrate pagerduty with ServiceNow. I have created a custom field in pagerduty & I have a custom field on incident form as well now I want to map that field with the incident field in ServiceNow. I have follow the steps which is written in the document.
Document Link : https://support.pagerduty.com/docs/advanced-servicenow-configuration#custom-field-mappings
as they mention the steps that "
- Navigate to Custom Field Mappings.
- Select New from the top right.
- Select a ServiceNow field (Required): Select your preferred ServiceNow field from the dropdown. We will only fetch ServiceNow fields that match the approved field types.
- Enter the following under Configure the new PagerDuty field:
- Display Name: Enter a display name for the PagerDuty incident UI.
- Field Name: Enter a field name.
- Description (Optional😞 Enter an optional description.
- Review the mapping and then click Save.
In service now there no such kind of module "Custom Field Mappings".
How can I map the custom field with ServiceNow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2024 02:33 AM
Hi @zee15 , could you share an example of the dot walking you used on the Inbound Field Rule?
I was trying something like custom_fields.'name_of_the_custom_field' but it didn't work for me.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2024 02:52 AM - edited 12-05-2024 02:55 AM
Hi @Gon_alo Oliveir You can take a reference from this Snapshot which I attached below :
And in script field you can add this code :
var parsedData = value.details;
var result = "";
var description = "";
if (typeof parsedData == "string") {
result = parsedData;
} else if (parsedData !== null && typeof parsedData === "object") {
for (var key in parsedData) {
description += key + " : " + parsedData[key] + "\n";
}
result = description;
}
Change the condition accordingly
Also you can take a reference from pagerduty doc : https://developer.pagerduty.com/docs/88922dc5e1ad1-overview-v2-webhooks
If this information was helpful, please mark this answer as Accepted as Solution and hit the helpful button. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2024 03:17 AM
Thank you for the fast reply @zee15 !
I was able to get the custom field value using: "data.custom_fields.value".
Maybe this only works because I only have a custom field defined.
I will also take a look at what you mentioned!
Thank you once again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 10:24 AM
If there is more than one custom field, it only seems to return the first instance of "data.custom_fields.value". Are you only bringing back one custom_field value, or have you attempted multiple yet?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 10:37 AM
Figured multiple custom fields out. If you set the value of PagerDuty webhook payload field to "data.custom_fields" then it returns the objects in the value. From there you can search through for the value related to the name of the custom_field
for (var i = 0; i < value.length; i++){
var fieldName = value[i].name;
var fieldValue = value[i].value;
}