getAutomationsCount
Get the count of OOTB, custom and deprecated automations.
python · System Diagnostics and Health Check
Details
| ID | getAutomationsCount |
|---|---|
| Language | python |
| From Version | 6.10.0 |
| Docker Image | demisto/python3:3.12.13.11879924 |
| Tags | statusreview widget |
README
Get the count of OOTB, custom and deprecated automations count
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Tags | statusreview, widget |
Inputs
There are no inputs for this script.
Outputs
There are no outputs for this script.
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 payload1 = {"query": "system:T"} res1 = demisto.executeCommand("core-api-post", {"uri": "automation/search", "body": json.dumps(payload1)})[0]["Contents"][ "response" ] if not res1["scripts"]: res1["scripts"] = [] payload2 = {"query": "system:F"} res2 = demisto.executeCommand("core-api-post", {"uri": "automation/search", "body": json.dumps(payload2)})[0]["Contents"][ "response" ] if not res2["scripts"]: res2["scripts"] = [] payload3 = {"query": "deprecated:T"} res3 = demisto.executeCommand("core-api-post", {"uri": "automation/search", "body": json.dumps(payload3)})[0]["Contents"][ "response" ] if not res3["scripts"]: res3["scripts"] = [] wList = [] wList.append({"OOTB": len(res1["scripts"]), "Custom": len(res2["scripts"]), "Deprecated": len(res3["scripts"])}) return_results({"total": len(wList), "data": wList})