- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
01-02-2023 04:34 AM
Hi,
Can someone help me to call a method of one automation from a other automation script. Can't copy past the code into other, because the code requires different docker image to run.
Thanks in advance 🙂
01-03-2023 12:19 AM - edited 01-03-2023 12:19 AM
executeCommand can also be used to call (custom) automations, so if you can make that method as an automation itself it would solve it.
Another option is to add the method to the CommonServerUserPython automation, which is essentially a python file that gets copied into each automation upon runtime and can thus be called from all python automations.
Beware that this last option needs the method to be py2 and py3 compatible to include it in all python automation, this is the reason we mainly use option 1 as it also allows us to run code cross language, like javascript executing python or even powershell methods (automations).
01-02-2023 07:14 AM
Javascript: executeCommand("[command_name]", [params_in_json])
Python: demisto.executeCommand("[command_name]", [params_in_json])
01-02-2023 11:50 PM
Hi @Joachimb
Thanks for your reply. I would like to call a method from a custom automation script into another custom automation script. could you suggest the way to do that. I believe demisto.executeCommand is used to call built-in commands.
01-03-2023 12:19 AM - edited 01-03-2023 12:19 AM
executeCommand can also be used to call (custom) automations, so if you can make that method as an automation itself it would solve it.
Another option is to add the method to the CommonServerUserPython automation, which is essentially a python file that gets copied into each automation upon runtime and can thus be called from all python automations.
Beware that this last option needs the method to be py2 and py3 compatible to include it in all python automation, this is the reason we mainly use option 1 as it also allows us to run code cross language, like javascript executing python or even powershell methods (automations).
01-03-2023 03:28 AM
Thanks a lot! its worked
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!