How do I extract just part of a 'webResponse'

SGC Associates Ltd
Contributor
December 30, 2024

 

How do I extract just part of a 'webResponse'

I have the following from a 'Send Web Request'

WebhookResponseBean{status=200, statusCategory=SUCCESS, headers={Connection=[keep-alive], Content-Length=[350], Content-Type=[application/json], Date=[Mon, 30 Dec 2024 23:01:01 GMT], Server=[Werkzeug/3.1.3 Python/3.13.0], Via=[1.1 ip-10-125-126-85 (squid)], X-Cache=[MISS from ip-10-125-126-85]}, body={message=To archive......

I just want to extract anything after the message=

How do I do this ( So I can add it as a comment on an issue )

Thanks in advance

1 answer

1 accepted

6 votes
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 30, 2024

Hi @SGC Associates Ltd and welcome to the Community!

You'll want to use:

{{webResponse.body.message}}

 

SGC Associates Ltd
Contributor
December 30, 2024

Darryl

Thanks for that

But doesnt seem to work, I have tried variations but to no avail

Is there a way to use something like javascript etc ?

Many Thanks

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 30, 2024

I was trying to find documentation for this, but it's embarrassingly scant:

Probably the best documentation is from Automation itself:


How do I access web request response values in subsequent rule actions?

To access the response data you will need to select the 'Delay execution' checkbox above.

On successful web request, you will be able 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}}
Like Steffen Opel _Utoolity_ likes this
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 30, 2024

Hi @SGC Associates Ltd, I'm sorry to hear you're having issues. If you can, it'd be helpful if you can take a screenshot of your rule or at least the parts with the web request and the part for the Comment.

This is an example of what should work in your case:

Screenshot 2024-12-30 at 4.07.03 PM.png

Hmmmm, actually, considering what you posted includes Webhook... maybe you're on Data Center (on-prem)? Sorry my bad for ASSuming you were on Cloud.

If you are on Data Center, you would want to use:

{{webhookResponse.body.message}}

SGC Associates Ltd
Contributor
December 30, 2024

Sorry, It does work,

Just takes a few seconds to add !

 

Many Thanks

Truly appreciated

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events