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.
Thanks for reporting this. We've started looking into this and already identified the issue. Expect a fix for this soon!
Progress on this can be tracked here: https://codebarrel.atlassian.net/browse/AUT-1943
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, although it seems this was fixed, I am now seeing the same issue again. Has this regressed by any chance?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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]}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any news about this? I have the same problem! Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am also having this issue. Seems like it was fixed for a time but has reappeared as an issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe it's still not working. I cannot get any values with dot notation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tried and the dot notation is still not working on jira automation
{{webhookResponse.body.id}} -> gives me an empty value
{{webhookResponse.body}} -> gives me this
{
"id" : "1",
"name": "ewww"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dot notations for webhook.body seems to not work again in Jira Automation. We're getting empty values.
We have existing automation rules that just started breaking.
We're using the workaround with `substringBetween` suggested in one of the comments we need a solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I typed it wrong when posting but the issue remains the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mine works after leaving the item in the image set:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any acknowledgment from Atlassian that this is an issue? Its not working for me. Does anyone have any docs explain how substringBetween works? I'd like to try that, but the pasted example does not work...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me:
{{webhookResponse.body.substringBetween("id\":", ",")}}
It won't work if the key is the last one in the JSON, in which case you'll need to do:
{{webhookResponse.body.substringBetween("id\":", "}")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.