I try to send webhook for some interogation. How to treat failed requests into an if/else block?

Richard Vencu
Contributor
November 24, 2020

I am querying a webhook for some value. If the value is not found I get this error from the webhook:

 

Action details:

Send web request

Error response HTTP body:{"errors":{},"errorMessages":["The property worktype does not exist."],"httpStatusCode":{"present":true}}Error publishing webhook. Response HTTP status:404

 

I tried to use an if/else block with these conditions: {{webhookResponse.status}} equals 200 and 404 but I am still getting the error like the condition is never tested (i.e. the failed send webhook test stops execution of the rest of the rule).

2 answers

1 accepted

0 votes
Answer accepted
Richard Vencu
Contributor
November 25, 2020

I used another API endpoint and condition as a workaround for this problem:

image.png

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 25, 2020

Hi @Richard Vencu ,

Have you worked around your issue then or did you still need some assistance?

Richard Vencu
Contributor
November 25, 2020

Thanks for asking. My particular problem is solved but the general question still stands.

Is it possible to test webresponse status code and follow if/else branches in case it is not 2xx type?

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 26, 2020

Hi @Richard Vencu,

I'm afraid not. We have got an improvement tracking this, which would add the option to allow the rule to continue on a non 2xx response.

https://codebarrel.atlassian.net/browse/AUT-1622

Cheers,

Simeon.

Like Richard Vencu likes this
Muhammad Ramzan(Atlassian Certified Master)
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.
January 16, 2021

@Simmo , thanks for creating the ticket, any idea when we can expect the resolution. This is important to handle it because , in my scenario I have multiple calls and actions based on the status if its 200,404,400 or 500.

I am adding comments , doing some other actions but in this case i would not be able to do anything if the status received other than 200.

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 4, 2021

Hi @Muhammad Ramzan(Atlassian Certified Master) ,

I'm afraid it isn't prioritised at the moment. The best cause of action for you to take if you want to try and get it pushed along is to raise a support ticket.

Cheers,

Simeon

Thomas Balasch
Contributor
September 28, 2023

Hi @Simmo ,

have there been any changes on the matter as I don't have access to the linked tickets?

We are having problems due to the response timing out after 30 seconds even though the request was successfull.
Most likely depending on the performance of the responding server, this breaks the flow of our automation regularly.

Thanks!

Best Regards,

Thomas

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 2, 2023

Hi @Thomas Balasch,

This is quite an old thread! The AUT tickets have been dropped in favour of the https://jira.atlassian.com/projects/AUTO/summary project.

I'm not sure that this got traction. Best is to see if you can find it on there and if not, raise a suggestion/bug :) 

0 votes
Richard Vencu
Contributor
November 24, 2020

image.png

Suggest an answer

Log in or Sign up to answer