- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
12-20-2023 12:45 AM
Hi @Syedhkt ,
If you want to get only the numbers, you don't need to use a script. Dashboard data sources are capable of it. I am sending an example. You can play with data using an automation script for the second question. For example, If you want to play with the incident data, you can use the below commands to get the incidents and then do some calculations according to your needs.
res = demisto.executeCommand("GetIncidentsByQuery", {"fromDate": "5 days ago", "query":"-status:closed"})[0]['Contents']
incidents = json.loads(res)
As a reference, please see the attachment for a widget automation script which calculates the task duration using /workers/status API endpoint.