AssignToNextShift
Randomly assigns the incidents to users on call (requires shift management) and users on call. See for more information: [Cortex XSOAR 6.13](https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.13/Cortex-XSOAR-Administrator-Guide/Shift-Management) [Cortex XSOAR 8 Cloud](https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8/Cortex-XSOAR-Cloud-Documentation/Manage-roles-in-the-Cortex-XSOAR-tenant) [Cortex XSOAR 8.7 On-prem](https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8.7/Cortex-XSOAR-On-prem-Documentation/Manage-roles-in-the-Cortex-XSOAR-tenant) Incident IDs should be passed as a comma-separated list. This automation runs using the default Limited User role, unless you explicitly change the permissions. For more information, see the section about permissions here: - For Cortex XSOAR 6 see https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.x/Cortex-XSOAR-Playbook-Design-Guide/Automations - For Cortex XSOAR 8 Cloud see https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8/Cortex-XSOAR-Cloud-Documentation/Create-a-script - For Cortex XSOAR 8.7 On-prem see https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8.7/Cortex-XSOAR-On-prem-Documentation/Create-a-script
Source
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 # check if we have any users on call to assign to users_on_call = demisto.executeCommand("getUsers", {"onCall": "true"})[0]["Contents"] # if we don't have on shift users, return error, else reassign the provided incident id's to the on-call analysts if not users_on_call: return_error("No users on shift") else: incident_id = demisto.args().get("incident_id") demisto.results( demisto.executeCommand( "executeCommandAt", {"command": "AssignAnalystToIncident", "arguments": {"onCall": "true"}, "incidents": incident_id} ) )
README
Randomly assigns the incidents to users on call (requires shift management) and users on call.
See for more information:
Cortex XSOAR 6.13
Cortex XSOAR 8 Cloud
Cortex XSOAR 8.7 On-prem
Incident Ids should be passed in as a comma separated list.
Permissions
This automation runs using the default Limited User role, unless you explicitly change the permissions.
For more information, see the section about permissions here: For Cortex XSOAR 6, see the https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.x/Cortex-XSOAR-Playbook-Design-Guide/Automations for Cortex XSOAR 8 Cloud, see the https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8/Cortex-XSOAR-Cloud-Documentation/Create-a-script for Cortex XSOAR 8 On-prem, see the https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8.7/Cortex-XSOAR-On-prem-Documentation/Create-a-script.
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Tags | |
| Cortex XSOAR Version | 6.0.0 |
Inputs
| Argument Name | Description |
|---|---|
| incident_id | The Incident IDs to reassign, can be a comma separated list (e.g. 1,2,3,4) |
Outputs
There are no outputs for this script.