Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

{{webhookResponse.body.foo}} smart value is flat-out not working

Edited

I am currently experimenting with the "Send Web Request" action in JIRA automation. The documentation suggests that you can parse a web response (if the "wait for response option" is checked) as follows:

In successful webhook execution, you would be able access webhook response data using the following smart values:

{{webhookResponse.body}} returns the response body, if the body is a JSON object then you can access values using dot notation e.g. {{webhookResponse.body.name}}

In this screenshot of the audit log, you can see the first log action where I'm logging {{webhookResponse.body}}. This works just fine. But when I try to evaluate a JSON property in the second log action using {{webhookResponse.body.error}}, you can see it evaluates as an empty string.

 

image.png

2 answers

1 accepted

0 votes
Answer accepted

Thanks for reporting this. We've started looking into this and already identified the issue. Expect a fix for this soon!

sreuter Atlassian Team May 28, 2020

Progress on this can be tracked here: https://codebarrel.atlassian.net/browse/AUT-1943

sreuter Atlassian Team May 31, 2020

This has been deployed to production 5 minutes ago. We successfully confirmed the fix with our own testing services, as well as the Slack API via https://api.slack.com/methods/api.test :)

@Jaroslaw Wojciechowski @Michael Skiles Please let us know if this fixes things for you as well!

Works for me now. Thank you for fixing this.

Like sreuter likes this

Hi, although it seems this was fixed, I am now seeing the same issue again. Has this regressed by any chance?

Like Nick Canada likes this

Specifically, my results are:

{{webhookResponse.body}}

{"data":{"rows":[ ["2020-04-18"] ], "cols":... "status":"completed"}

{{webhookResponse.body.status}}

Empty string.

 

"status" is a top-level field on the body. Fields like {{webhookResponse.body.data}} also fail, but what I really want to access is {{webhookResponse.body.data.rows[0][0]}}

sreuter Atlassian Team Jun 02, 2020

@Dean Putney It's a bit hard to tell, as you shortened the response object (I see a missing closing bracket in your example), but is it possible that status is part of data?

Otherwise, could you send us a screenshot of the response headers you get from your endpoint, ideally from using curl -v to do the same query?

Apologies for shortening the response too much, I corrected for clarity in some edits here. There are no missing brackets and it is a valid JSON object in my test. "status" is a top level field on the body. Similarly, "data" returns an empty string as well.

Regarding the headers, is there a way I can send that information privately?

sreuter Atlassian Team Jun 02, 2020

Sure, I'm sreuter@ :) 

Thank you, I've sent you an email with this information.

Like sreuter likes this
sreuter Atlassian Team Jun 02, 2020

Got it, answer sent :)

I have the same issue, that I am trying to access a web request hook response similar to the above {{webhookResponse.body.data.rows[0][0]}}. where the data is within an array. Is this notation supported?

I am trying to use the following syntax in an email to loop items in the array.

{{#webhookResponses.body.query_results.column_positions}}

Data from response: {{[0].[0].name}}
{{/}}

@Darren Lattin Hi. I was able to get this functioning– for array/list accessors use .get(0)

https://support.atlassian.com/jira-software-cloud/docs/smart-values-lists/

Hey, I am having exactly the same error:

 

This works fine

{webhookResponse.body}}

 

and it returns the following json:

{
"ok": true,
"group": {
"id": "xxxxxx",
"name": "xxxxx",

....

}

But then when I try to access anything within a response json nothing is working

{{webhookResponse.body.ok}}

{{webhookResponse.body.group}}

{{webhookResponse.body.group.id}}

Hey,

Was this problem ever resolved for you?

I am trying to do the same thing by trying to access id using {{webhookResponse.body.success_record_info.id}}. But nothing is returned

---------what {{webhookResponse.body}} returns-----

---------------------------------------------------------------------------- 

{

"status": "processed",

"input_record_count": 1,

"success_record_info": [

          {

          "index": 1,

          "id": 33,

          "type": "issue"

          }

],

....

 }

----------------------------------------------------------------------------

Even using {{webhookResponse.body.status}} returns nothing but an empty string for me.

I can see that this was resolved for others in this question but was it something done on Atlassian's side or something you were instructed to change/do?

What the exact solution is is unclear

Thanks in advance for anyone who responds :) 

Like # people like this

Any news about this? I have the same problem! Thanks

Like # people like this

I am also having this issue. Seems like it was fixed for a time but has reappeared as an issue?

I believe it's still not working. I cannot get any values with dot notation.

If this helps anyone

I did end up reaching to Atlassian Support and they gave me a smart-value to use that did work for a while

{{ webhookResponse.body.substringBetween("id\":", ",") }} 

 But I believe sometime in the summer of 2021, using the expected notation of 

{{ webhookResponse.body.success_record_info.id }}

did start working for me and is still working. Last tested December 20, 2021

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you