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

Custom fields how to identify them

Carol Saldanha August 14, 2022

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

3 answers

1 accepted

0 votes
Answer accepted
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 15, 2022

Hi @Carol Saldanha ,

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 to determine what you might need to extract the field or value:

cf1.1.jpg

cf2.1.jpg

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

Carol Saldanha August 15, 2022

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

Like Nick H likes this
Elzha Odie March 4, 2023

Hi @Nick H is it possible to extract the value of this nested fieldUntitled.png

Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2023

This Community Article should help with extracting that: How to Extract Custom Fields and Data into an Alert

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

{{customFields.customfield_10072.name}}
Elzha Odie March 4, 2023

Thankyou for the respon @Nick H i had already tried as yours but still don't get the value.. is there any solutions?Untitled.png

Elzha Odie March 4, 2023

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 

Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2023

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}}
0 votes
Carol Saldanha August 15, 2022

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

0 votes
Thuan_ Do Dang
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.
August 15, 2022

Hi @Carol Saldanha ,

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

Hope this helps!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events