Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use previous webhook log result?

Sere Walkens July 6, 2023

I am building an automation for my team. In that automation, I plan to first send a web request, save the result, then send another. I noticed that the log overwrote the first web request's result when I received the result of the second web request.

Is there a way to save both the requests' result? Because in my following actions, I need to use the results from both requests. In some posts, it mentioned that I can create variables to save the information. But I did not find it in the "action" section. 

Any help would be appreciated!

1 answer

2 votes
Fred Momeni
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 9, 2023

Hi @Sere Walkens 

To access the response data you will need to select the 'Delay execution' checkbox in the web request component.

On successful web request, you will be able to access response data using the following smart values:

  • {{webResponse.status}} returns the response code e.g. 200
  • {{webResponse.statusCategory}} returns the category of the response status - INFO, SUCCESS, REDIRECT, CLIENT_ERROR, SERVER_ERROR, OTHER
  • {{webResponse.headers}} returns the response headers that you can access using dot notation e.g. {{webResponse.headers.Content-Type}}
  • {{webResponse.body}} returns the response body, if the body is a JSON object then you can access values using dot notation e.g. {{webResponse.body.name}}
  • {{webResponses}} returns a list of the 10 most recent responses this rule received. E.g. {{webResponses.last.body}}

You can also use the `Create variable` component to set any of the values in the response to a variable and use it as a smart value later in the rule.

Sere Walkens July 11, 2023

Thank you! I didn't find "Create variable" in "New action" part. Do you know why?

The web response one did help! I used {{webhookResponses.last.body.result}} and {{webhookResponses.first.body.result}} and it worked. Is there a difference between webhookResponses and webResponses?

Screenshot 2023-07-11 110742.png

Sere Walkens July 12, 2023

Do you know how should I find the result for some responses in webResponses? I tried webhookResponses.first.body, webhookResponses.last.body, it all worked. But webhookResponses.second.body didn't return anything.

 

Thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, jira service management, jsm webinar, ai in jsm, opsgenie integration, incident management, virtual agent, atlassian intelligence, ai-powered service desk, it operations, atlassian learning, service management webinar, team '25 recap

What’s new in Jira Service Management 🤔

Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.

Register here ⬇️
AUG Leaders

Atlassian Community Events