Hi all,
Glad to finally be here. We have the following API problem(ofc beautified)
Post asset creates an asset, let us assume the following:
“id”: “51fc4807-d3ed-4b6e-b1f8-ee3eb2e18a96”,
“name”: “Tolik87”,
“description”: “APIDescription”,
“status”: “DAMNED”,
and after that another POST that changes the status of the asset to NOT-DAMNED (it is a job that takes around 3 mins). I want to be able to poll it for when the status becomes NOT-DAMNED, so hitting the API every 30 sec to check if the status is NOT-DAMNED
This should do the trick:
const response = pm.response.json();
if (response.status !== “NOT-DAMNED”) {
setTimeout(() => {}, 30000)
postman.setNextRequest(pm.info.requestId)
}
However I am looking for something to break my loop if it never becomes “NOT-DAMNED”. Anyone can help with that. Tried to save counter in an environment variable but maybe am too stupid to write that script by myself