You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在XSOAR集成中调用demisto.executeCommand()?异常求助

解决XSOAR集成中调用demisto.executeCommand()报错的问题

问题核心

在XSOAR集成代码中调用demisto.executeCommand()时触发'Demisto' object has no attribute 'executeCommand'错误,但该方法在自动化脚本中可正常运行。

原因

XSOAR的**集成(Integration)与自动化脚本(Automation Script)**使用不同的API规范:

  • 自动化脚本采用旧版驼峰式API,支持demisto.executeCommand()
  • 集成基于Python SDK开发,使用下划线式API,对应方法为demisto.execute_command()

解决方案

将集成代码中的demisto.executeCommand()替换为demisto.execute_command(),并保持参数格式一致:

示例修改

自动化脚本中的可行写法:

incidents = demisto.executeCommand("getIncidents", {"query": "type:saved"})

集成代码中修改为正确写法:

incidents = demisto.execute_command("getIncidents", {"query": "type:saved"})

验证

修改后在XSOAR IDE中重新运行集成代码,即可正常调用服务器命令获取已保存事件。

内容的提问来源于stack exchange,提问作者Rakshit Karande

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 13:20:50