Custom fields how to identify them
Asked by Carol Saldanha:

Hi there,

We have a Request form that is being used as part of a JSM Portal Configuration. When an issue is logged via the portal, an alert is created in Opsgenie. We have configured the integration to display some fields in the alert that is created. We identified the custom field by adding {{_payload}} to the description field as suggested in this forum. I now want to display other custom fields from the request form in the alert e.g email address and contact number - but am not seeing these in the payload when the alert is created.

Any help on how to identify the custom fields number?

Thanks,

Carol


Answers:
author: Nick H
body: Hi [@Carol Saldanha](/t5/user/viewprofilepage/user-id/4649403) ,

If you are parsing the entire {{_payload}} to the description field, and *custom fields from the request form in the alert e.g email address and contact number* are not shown, then I'd assume they are not sending from Jira / JSM to Opsgenie.

Are you not seeing these fields at all in the Opsgenie alert? Have you tried a Crtl + F for the expected value?

I typically take the entire payload and use a [JSON formatter](https://jsonformatter.curiousconcept.com/#) to determine what you might need to extract the field or value:  

![cf1.1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/211111i962A88BCAADF1752/image-size/large?v=v2&px=999 "cf1.1.jpg")

![cf2.1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/211113iDA58103ACBCF9823/image-size/large?v=v2&px=999 "cf2.1.jpg")

![vf3.1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/211114i24798EEDDAA6B950/image-size/large?v=v2&px=999 "vf3.1.jpg")

As you can see, the custom field is nested, so I could use something this below to extract it:

```
{{_payload.issue.fields.customfield_10048}}
```

![cf4.1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/211115i4F393B9FCC4426E2/image-size/large?v=v2&px=999 "cf4.1.jpg")

comments: author: Carol Saldanha
body: Thank you - that was very helpful. The issue was that the fields I was sending from a form were not linked to JSM custom fields hence not being sent in the payload (as you suggested)

I have access to them now.

Many thanks,

Carol


author: Elzha Odie
body: Hi [@Nick H](/t5/user/viewprofilepage/user-id/2540930) is it possible to extract the value of this nested field![Untitled.png](https://community.atlassian.com/t5/image/serverpage/image-id/243806i808805357A781672/image-size/large?v=v2&px=999 "Untitled.png")


author: Nick H
body: This Community Article should help with extracting that: [How to Extract Custom Fields and Data into an Alert](https://community.atlassian.com/t5/Opsgenie-articles/How-to-Extract-Custom-Fields-and-Data-into-an-Alert/ba-p/2133902)

If I had to guess, you may need something like this to extract that field into the alert:

```
{{customFields.customfield_10072.name}}
```


author: Elzha Odie
body: Thankyou for the respon [@Nick H](/t5/user/viewprofilepage/user-id/2540930) i had already tried as yours but still don't get the value.. is there any solutions?![Untitled.png](https://community.atlassian.com/t5/image/serverpage/image-id/243813iD552B5291F61A90A/image-size/large?v=v2&px=999 "Untitled.png")


author: Elzha Odie
body: actually i want to retrieve not only when issues are created, but also updated or resolved. i've problem in this.. the payload is only show fields when issue is created [@Nick H](/t5/user/viewprofilepage/user-id/2540930)


author: Nick H
body: It's only possible to extract the fields when the issue is created.

The field you highlighted in your screenshot differs from the one I had suggested above, and includes "_payload"

Please try with these:

```
{{customFields.customfield_10072}}

{{customFields.customfield_10072.name}}
```


author: Carol Saldanha
body: Hi,

Thanks for the reply, but i don't see the custom fields when I try that. The custom field that I can see in the payload for the Opsgenie alert doesn't show up when I try and search using the method you've suggested above.

I think I need to find out why some custom fields are being dumped in the payload and some are not.

Any help would be appreciated.

Carol


author: Thuan_ Do Dang
body: Hi [@Carol Saldanha](/t5/user/viewprofilepage/user-id/4649403) ,

To get your custom field number, you can go to advance issue search with JQL -\> type your custom field name -\> see the suggestion, cf\[xxxxx\] is your custom field id -\> customfield_xxxxx is your field in smart value.

![find custom field id.png](https://community.atlassian.com/t5/image/serverpage/image-id/211031i4FBE22FFD4C6F51E/image-size/large?v=v2&px=999 "find custom field id.png")

Hope this helps!


Tags: cloud