Hi,
I created a workflow with “HTTP request” action and compare strings operator after that to look for HTTP status code .
Though our API response returns 202 as a status code, the workflow does not consider that as a true condition and it goes to a false condition. ($.hTTPRequest.statusCode = 202). When I change the compare strings to ($.hTTPRequest.body = Accepted), it works.
I believe there is some issue with hTTPRequest.statusCode and you can see the values of the response in the below screenshot.
“result”:{“body”:“Accepted”,“headers”:null,“responseTime”:“0.033403 seconds”,“statusCode”:202} (Why is 202 not in double quotation marks?)
I have included the header Accept:application/json
I have verified that this is a bug. The value you provide in Value 2 gets converted to a string in the script, which will result in a False value every time because you can’t compare a number with a string. I have opened a bug ticket for engineering to resolve this. In the meantime, you can fix this issue by downloading the workflow script and manually updating Value 2 to be the integer representation of 202.
For example, here is a snippet of my workflow script where Value 2 is saved as a string.