diff --git a/Packs/CommonWidgets/.pack-ignore b/Packs/CommonWidgets/.pack-ignore index e5a35491c45..6dbdac89605 100644 --- a/Packs/CommonWidgets/.pack-ignore +++ b/Packs/CommonWidgets/.pack-ignore @@ -1,6 +1,3 @@ -[file:MyToDoTasksWidget.yml] -ignore=RM109 - [known_words] GetLargestInvestigations GetLargestInputsAndOutputsInIncidents diff --git a/Packs/CommonWidgets/ReleaseNotes/1_2_25.md b/Packs/CommonWidgets/ReleaseNotes/1_2_25.md new file mode 100644 index 00000000000..f0ee001ac3e --- /dev/null +++ b/Packs/CommonWidgets/ReleaseNotes/1_2_25.md @@ -0,0 +1,7 @@ + +#### Scripts + +##### MyToDoTasksWidget + +- Fixed an issue that prevented the script from showing open tasks for users who had a significant number of closed tasks assigned to them. +- Updated the Docker image to: *demisto/python3:3.10.12.63474*. diff --git a/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/MyToDoTasksWidget.py b/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/MyToDoTasksWidget.py index 4d6aaba3081..02a6f104a9d 100644 --- a/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/MyToDoTasksWidget.py +++ b/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/MyToDoTasksWidget.py @@ -1,14 +1,16 @@ -import demistomock as demisto # noqa: F401 -from CommonServerPython import * # noqa: F401 from dateparser import parse +import demistomock as demisto +from CommonServerPython import * +MAX_ENTRIES = 30 def get_open_to_do_tasks_of_current_user() -> List[Dict]: body = { "dataType": "todos", - "query": "assignee:\"{me}\"", - "widgetType": "table" + "query": "assignee:\"{me}\" and status:\"open\"", + "widgetType": "table", + "size": MAX_ENTRIES, } todo_tasks_query_res = demisto.internalHttpRequest( 'POST', @@ -47,10 +49,13 @@ def get_open_to_do_tasks_of_current_user() -> List[Dict]: return table -def main(): +def main(): # pragma: no cover try: results = get_open_to_do_tasks_of_current_user() - table_name = f'My ToDo Tasks ({len(results)})' + if len(results) >= MAX_ENTRIES: + table_name = f'My ToDo Tasks (First {MAX_ENTRIES} Tasks)' + else: + table_name = f'My ToDo Tasks ({len(results)})' readable_output = tableToMarkdown(table_name, results, headers=list(results[0].keys()) if results else None) cmd_results = { 'Type': entryTypes['note'], diff --git a/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/MyToDoTasksWidget.yml b/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/MyToDoTasksWidget.yml index 875c407be8f..f351b5edd8a 100644 --- a/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/MyToDoTasksWidget.yml +++ b/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/MyToDoTasksWidget.yml @@ -10,7 +10,7 @@ tags: timeout: '0' type: python subtype: python3 -dockerimage: demisto/python3:3.10.5.31928 +dockerimage: demisto/python3:3.10.12.63474 fromversion: 6.1.0 tests: - No test diff --git a/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/README.md b/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/README.md new file mode 100644 index 00000000000..889f9c9d091 --- /dev/null +++ b/Packs/CommonWidgets/Scripts/MyToDoTasksWidget/README.md @@ -0,0 +1,26 @@ +A script that creates a table of all the ToDo tasks assigned to the current user. + +## Script Data + +--- + +| **Name** | **Description** | +| --- | --- | +| Script Type | python3 | +| Tags | widget | +| Cortex XSOAR Version | 6.1.0 | + +## Inputs + +--- +There are no inputs for this script. + +## Outputs + +--- +### Human Readable Output + +>### My ToDo Tasks (1) +>|Task Name|Task Description|Task ID|SLA|Opened By|Incident ID| +>|---|---|---|---|---|---|---| +>| task | task description | 1@1 | 0001-01-01 00:00:00+0000 | user | 1 | \ No newline at end of file diff --git a/Packs/CommonWidgets/pack_metadata.json b/Packs/CommonWidgets/pack_metadata.json index f516d52ca5f..4adddce6425 100644 --- a/Packs/CommonWidgets/pack_metadata.json +++ b/Packs/CommonWidgets/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Common Widgets", "description": "Frequently used widgets pack.", "support": "xsoar", - "currentVersion": "1.2.24", + "currentVersion": "1.2.25", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",