Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Send web request, handle response code not equal to 200

johanzetterlund
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 18, 2021

Hi,

I am trying to write an Jira Project Automation that sends a webrequest. 

If I get a response code that is NOT 200 I would like to send another webrequest to another url.

I am trying to use:

If: matches

{{webhookResponse.status}} does not equal 200script.png

But the problem is that Jira Automation stops the execution if the webhook response isn't 200 so it is not event trying to send to my second webserver.

This is the Audit log:

Status: SOME ERRORS

Action details:

Send web request

Error response HTTP body:Error publishing webhook. Response HTTP status:400

auditlog.png

 

Is it possible to read the response.status and send a new webrequest if it's not 200?

3 answers

1 accepted

2 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.
January 18, 2021

I'm thinking it's not possible. I had a web request that had a possibility of failing, and I tried to "trap" for unsuccessful requests by checking {{webhookResponse.status}}. It never worked.

Alas, upon closer inspection, you only that smart value that if it's successful:

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

I think we'll need to ask for a Feature Request. :-}

johanzetterlund
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 18, 2021

Thanks for the reply!

Hmm ok, I'll have to work around this in another way, then.

Like Darryl Lee likes this
Kerrick Cavanaugh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2024

Is there an update on this? I am trying to do the same.

 

Like abderrahmane.zaibak likes this
0 votes
Kevin Bianchi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 28, 2022

For information, since version 8.0 from Jira Automation.

The rule now continue even if the response is in error.

This will allow to test this value.

https://confluence.atlassian.com/automation/send-web-request-action-now-provides-response-data-993924775.htm 

What is strange is that ticket https://jira.atlassian.com/browse/JIRAAUTOSERVER-180  is still open.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events