Use REST api user query results in automation

Vytautas St December 16, 2021

Hi,

when I validate user query in automation Send Web Request action, it returns correct payload with all data I need. But loging {{webhookResponse.body}} gives empty  line.

Do I use wrong variable to read response from GET method? How to access payload fields?

Thank you,

Vytautas

1 answer

0 votes
Bill Sheboy
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.
December 16, 2021

Hi @Vytautas St 

That is the correct smart value, and you may need to use dot notation to look for the specifics you need.  https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--webhookResponse--

Have you checked the status to confirm the request succeeded?

Kind regards,
Bill

Vytautas St December 19, 2021

Thanks for hint, 

status 200, payload shows correct data when validating, but no logs when rule runs:

{{webhookResponse.body.accountId}} , {{webhookdata.accountid}},  {{webhookResponse.status}} are empty in log action audit.

It's user query, GET method.  Validation and rule test use the same issue key, actor permisions the same.

Bill Sheboy
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.
December 20, 2021

That is curious...Two other things to try:

In your rule, please try {{webhookResponses.last.body}} to see if that makes a difference when the response is a list; note the smart value is plural rather than singular.

And try running your request from a browser to examine the response with your parameters to see if it is structured as you expect.

Suggest an answer

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

Atlassian Community Events