- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
07-25-2022 02:52 AM
An Api call is created in an automation program. The call to the API needs to wait for a value to set to "FINISHED", so a while loop is created waiting for this value. However, I'd like to know the current status of this value setting the value in context.
Why is not setting this value on the context?
status=""
While status != "FINISHED":
status=doHttpRequest()
demisto.setContext("status", status)
07-25-2022 03:12 AM - edited 07-25-2022 03:14 AM
Did not test it inside a while loop.
The recommended way to do it is to return a scheduled command and not through a while loop.
https://xsoar.pan.dev/docs/integrations/scheduled-commands
Also, calling an API from an automation is kind of an anti-pattern(although it is possible). Usually, the automation will call an integration command that calls the API.
07-25-2022 03:06 AM
demisto.setContext("status", "test")
Something like the above worked for me
07-25-2022 03:12 AM - edited 07-25-2022 03:14 AM
Did not test it inside a while loop.
The recommended way to do it is to return a scheduled command and not through a while loop.
https://xsoar.pan.dev/docs/integrations/scheduled-commands
Also, calling an API from an automation is kind of an anti-pattern(although it is possible). Usually, the automation will call an integration command that calls the API.
07-25-2022 03:18 AM
Interesting, I'll study how to implement
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!