Accessing a custom field value using a webhook

Jamie Salter March 11, 2024

Hi all,

I am using a marketplace app for some secure custom fields as part of an approvals process. I have setup a web request to access this field as part of an automation to record some information at the point the field is filled out. 

As part of the automation I have a smart value comparison field in an IF function that I want to use to look at the webresponse value. The secure custom field is a checkbox with Approve being the option I want to look at.

Using this smart value: {{webhookRepsonse.body.fields}}

I can see this response: {customfield_10125=null}

But by then trying to go a step further to {{webhookRepsonse.body.fields.customfield_10125[0}.value}}

I get nothing.

my payload looks like this:

{
  "id": "11701",
  "key": "LAT001-829",
  "fields": {
    "customfield_10125": null
  }
}

image.png

To summarise, I would like to be able to read the custom field value and use it in the IF function to check whether it contains the word "Approved".

image.png

Any help would be greatly appreciated. 

1 answer

0 votes
Kalyan Sattaluri
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.
March 11, 2024

Hello @Jamie Salter 

You directly reference the field like below to access the value.

{{webhookRepsonse.body.fields.customfield_10125}}

 This Customfield is not an array so dont need to give index and the field itself is directly referencable. so ".value" is not needed.

Some fields do need you to reference .value or .name.. depends on the schema. Please review below article on identifying fields and suseqent identifers as needed. 

https://community.atlassian.com/t5/Automation-articles/Jira-Automation-Find-the-smart-value-for-a-field-to-build/ba-p/2390961

Hope it helps.

Jamie Salter March 12, 2024

Hi @Kalyan Sattaluri thank you for coming back to me, that article was helpful :).

I tried to just log the value using the smart value you inputted above but I didn't get an output, just this:

 image.png

I also tried getting it to spit out that response in a text field but again no luck.

Kalyan Sattaluri
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.
March 12, 2024

Hello @Jamie Salter Based on the snippet of the payload you have shared in your original post, You dont see any output because the field has none, it is null.

Please populate the field, make a web request call, sahre the payload and then log the smart value..

 

 

Suggest an answer

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

Atlassian Community Events