browsergym-workarena 0.2.1__py3-none-any.whl → 0.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. browsergym/workarena/__init__.py +13 -1
  2. browsergym/workarena/api/category.py +74 -0
  3. browsergym/workarena/api/change_request.py +87 -0
  4. browsergym/workarena/api/computer_asset.py +90 -0
  5. browsergym/workarena/api/cost_center.py +19 -0
  6. browsergym/workarena/api/expense_line.py +89 -0
  7. browsergym/workarena/api/incident.py +45 -0
  8. browsergym/workarena/api/knowledge.py +29 -0
  9. browsergym/workarena/api/problem.py +90 -0
  10. browsergym/workarena/api/report.py +183 -0
  11. browsergym/workarena/api/requested_items.py +63 -0
  12. browsergym/workarena/api/user.py +11 -8
  13. browsergym/workarena/api/utils.py +47 -3
  14. browsergym/workarena/config.py +21 -1
  15. browsergym/workarena/data_files/setup_files/forms/expected_incident_form_fields.json +1 -1
  16. browsergym/workarena/data_files/setup_files/forms/expected_request_item_form_fields.json +1 -0
  17. browsergym/workarena/data_files/setup_files/knowledge/protocols.json +46 -0
  18. browsergym/workarena/data_files/setup_files/knowledge/test.html +1 -0
  19. browsergym/workarena/data_files/setup_files/lists/expected_asset_list_columns.json +2 -24
  20. browsergym/workarena/data_files/setup_files/lists/expected_change_request_list_columns.json +4 -40
  21. browsergym/workarena/data_files/setup_files/lists/expected_expense_line_list_columns.json +12 -0
  22. browsergym/workarena/data_files/setup_files/lists/expected_hardware_list_columns.json +1 -42
  23. browsergym/workarena/data_files/setup_files/lists/expected_incident_list_columns.json +2 -18
  24. browsergym/workarena/data_files/setup_files/lists/expected_problem_list_columns.json +12 -0
  25. browsergym/workarena/data_files/setup_files/lists/expected_requested_items_list_columns.json +12 -0
  26. browsergym/workarena/data_files/setup_files/lists/expected_service_catalog_list_columns.json +2 -19
  27. browsergym/workarena/data_files/setup_files/lists/expected_user_list_columns.json +3 -50
  28. browsergym/workarena/data_files/task_configs/all_menu.json +1 -1
  29. browsergym/workarena/data_files/task_configs/dashboard_retrieval_minmax_task.json +1 -1
  30. browsergym/workarena/data_files/task_configs/dashboard_retrieval_value_task.json +1 -1
  31. browsergym/workarena/data_files/task_configs/filter_service_catalog_item_list_task.json +1 -1
  32. browsergym/workarena/data_files/task_configs/impersonation_users.json +1 -1
  33. browsergym/workarena/data_files/task_configs/report_retrieval_minmax_task.json +1 -1
  34. browsergym/workarena/data_files/task_configs/report_retrieval_value_task.json +1 -1
  35. browsergym/workarena/human_eval/console.js +176 -0
  36. browsergym/workarena/human_eval/tool.py +366 -0
  37. browsergym/workarena/install.py +81 -20
  38. browsergym/workarena/tasks/base.py +55 -20
  39. browsergym/workarena/tasks/comp_building_block.py +4 -0
  40. browsergym/workarena/tasks/compositional/__init__.py +76 -0
  41. browsergym/workarena/tasks/compositional/base.py +364 -0
  42. browsergym/workarena/tasks/compositional/dash_do_base.py +1366 -0
  43. browsergym/workarena/tasks/compositional/dash_do_catalog.py +1127 -0
  44. browsergym/workarena/tasks/compositional/dash_do_catalog_infeasible.py +2047 -0
  45. browsergym/workarena/tasks/compositional/dash_do_create_incident.py +403 -0
  46. browsergym/workarena/tasks/compositional/dash_do_create_incident_infeasible.py +278 -0
  47. browsergym/workarena/tasks/compositional/dash_do_create_problem.py +336 -0
  48. browsergym/workarena/tasks/compositional/dash_do_create_problem_infeasible.py +235 -0
  49. browsergym/workarena/tasks/compositional/dash_do_filter.py +1600 -0
  50. browsergym/workarena/tasks/compositional/dash_do_request_item.py +1315 -0
  51. browsergym/workarena/tasks/compositional/dash_do_request_item_infeasible.py +693 -0
  52. browsergym/workarena/tasks/compositional/delete_record.py +341 -0
  53. browsergym/workarena/tasks/compositional/edit_knowledge_base.py +457 -0
  54. browsergym/workarena/tasks/compositional/expense_management.py +598 -0
  55. browsergym/workarena/tasks/compositional/filter_and_do.py +139 -0
  56. browsergym/workarena/tasks/compositional/find_and_order_item.py +345 -0
  57. browsergym/workarena/tasks/compositional/manage_change_request_schedule.py +1417 -0
  58. browsergym/workarena/tasks/compositional/mark_duplicate_problems.py +499 -0
  59. browsergym/workarena/tasks/compositional/maximize_investment_return.py +1763 -0
  60. browsergym/workarena/tasks/compositional/navigate_and_do.py +1151 -0
  61. browsergym/workarena/tasks/compositional/navigate_and_do_infeasible.py +2100 -0
  62. browsergym/workarena/tasks/compositional/offboard_user.py +207 -0
  63. browsergym/workarena/tasks/compositional/onboard_user.py +226 -0
  64. browsergym/workarena/tasks/compositional/update_task.py +145 -0
  65. browsergym/workarena/tasks/compositional/utils/curriculum.py +215 -0
  66. browsergym/workarena/tasks/compositional/utils/infeasible_configs.py +151 -0
  67. browsergym/workarena/tasks/compositional/utils/knapsack.py +192 -0
  68. browsergym/workarena/tasks/compositional/warranty_check.py +227 -0
  69. browsergym/workarena/tasks/compositional/work_assignment.py +804 -0
  70. browsergym/workarena/tasks/compositional/workload_balancing.py +396 -0
  71. browsergym/workarena/tasks/dashboard.py +194 -12
  72. browsergym/workarena/tasks/form.py +1024 -232
  73. browsergym/workarena/tasks/knowledge.py +216 -25
  74. browsergym/workarena/tasks/list.py +519 -102
  75. browsergym/workarena/tasks/mark_duplicate_problem.py +171 -0
  76. browsergym/workarena/tasks/navigation.py +55 -13
  77. browsergym/workarena/tasks/scripts/extract_all_menu_items.py +9 -2
  78. browsergym/workarena/tasks/scripts/generate_dashboard_configs.py +6 -5
  79. browsergym/workarena/tasks/scripts/service_catalog.py +2 -1
  80. browsergym/workarena/tasks/scripts/validate.py +8 -2
  81. browsergym/workarena/tasks/send_chat_message.py +90 -0
  82. browsergym/workarena/tasks/service_catalog.py +94 -26
  83. browsergym/workarena/tasks/utils/form.py +1 -4
  84. browsergym/workarena/tasks/utils/private_tasks.py +63 -0
  85. browsergym/workarena/tasks/utils/utils.py +13 -0
  86. {browsergym_workarena-0.2.1.dist-info → browsergym_workarena-0.3.1.dist-info}/METADATA +19 -18
  87. browsergym_workarena-0.3.1.dist-info/RECORD +138 -0
  88. {browsergym_workarena-0.2.1.dist-info → browsergym_workarena-0.3.1.dist-info}/entry_points.txt +1 -0
  89. browsergym_workarena-0.2.1.dist-info/RECORD +0 -85
  90. {browsergym_workarena-0.2.1.dist-info → browsergym_workarena-0.3.1.dist-info}/WHEEL +0 -0
  91. {browsergym_workarena-0.2.1.dist-info → browsergym_workarena-0.3.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,1600 @@
1
+ import random
2
+ from playwright.sync_api._generated import Page
3
+
4
+ from .dash_do_base import DashboardRetrieveIncidentAndDoTask, DashDoFinalTask
5
+
6
+ from ..base import AbstractServiceNowTask
7
+ from ..dashboard import SingleChartMinMaxRetrievalTask, SingleChartMeanMedianModeRetrievalTask
8
+
9
+ from ...api.utils import table_api_call, db_delete_from_table
10
+ from ...instance import SNowInstance
11
+
12
+ from browsergym.workarena.tasks.navigation import AllMenuTask
13
+ from browsergym.workarena.tasks.list import (
14
+ FilterAssetListTask,
15
+ FilterHardwareListTask,
16
+ FilterIncidentListTask,
17
+ FilterUserListTask,
18
+ )
19
+
20
+
21
+ class DashboardRetrieveIncidentAndFilterListTask(DashboardRetrieveIncidentAndDoTask):
22
+ def __init__(
23
+ self,
24
+ instance: SNowInstance = None,
25
+ seed: int = None,
26
+ fixed_config: list[AbstractServiceNowTask] = None,
27
+ level: int = 2,
28
+ question: str = None,
29
+ dashboard_class: AbstractServiceNowTask = None,
30
+ ) -> None:
31
+ """
32
+ Retrieve the best or worst performing agent and filter a list based on their assignments.
33
+ Attributes:
34
+ -----------
35
+ task_description: str
36
+ The start of the task description to be completed.
37
+ short_description: str
38
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a list based on their assignments"
39
+ """
40
+ super().__init__(
41
+ instance=instance,
42
+ seed=seed,
43
+ fixed_config=fixed_config,
44
+ level=level,
45
+ question=question,
46
+ dashboard_class=dashboard_class,
47
+ )
48
+ self.prefix = "DIF"
49
+
50
+ def get_filter_config(self, attribute_name, filter_than) -> dict:
51
+ filter_values, agent_value_sysids = self.get_agent_values(
52
+ attribute_name=attribute_name, filter_than=filter_than
53
+ )
54
+ self.agent_value_sysids = agent_value_sysids
55
+ if len(filter_values) == 1:
56
+ filter_kind = "AND"
57
+ else:
58
+ filter_kind = "OR"
59
+
60
+ filter_config = {
61
+ "filter_columns": [self.attribute_name] * len(filter_values),
62
+ "filter_kind": filter_kind,
63
+ "filter_values": filter_values,
64
+ }
65
+ return filter_config
66
+
67
+
68
+ class DashboardRetrieveIncidentAndFilterAssetListTask(DashboardRetrieveIncidentAndFilterListTask):
69
+ def __init__(
70
+ self,
71
+ instance: SNowInstance = None,
72
+ seed: int = None,
73
+ fixed_config: list[AbstractServiceNowTask] = None,
74
+ level: int = 2,
75
+ max_assets_per_agent: int = 2,
76
+ question: str = None,
77
+ dashboard_class: AbstractServiceNowTask = None,
78
+ ) -> None:
79
+ """
80
+ Retrieve the best or worst performing agent and filter an asset list based on their assignments.
81
+ Attributes:
82
+ -----------
83
+ task_description: str
84
+ The start of the task description to be completed.
85
+ short_description: str
86
+ A short description of the task to be completed. "Filter the asset list based on incidents assigned to an employee"
87
+ """
88
+ super().__init__(
89
+ instance=instance,
90
+ seed=seed,
91
+ fixed_config=fixed_config,
92
+ level=level,
93
+ question=question,
94
+ dashboard_class=dashboard_class,
95
+ )
96
+ self.max_assets_per_agent = max_assets_per_agent
97
+ self.attribute_name = "assigned_to"
98
+
99
+ def set_compositional_task(self) -> None:
100
+ filter_config = self.get_filter_config(
101
+ attribute_name=self.attribute_name, filter_than=self.filter_than
102
+ )
103
+
104
+ filter_asset_list_subtask = [
105
+ # Navigate to the asset list
106
+ AllMenuTask(
107
+ instance=self.instance,
108
+ fixed_config={
109
+ "application": "Asset",
110
+ "module": "Portfolios > All Assets",
111
+ "url": "/now/nav/ui/classic/params/target/alm_asset_list.do",
112
+ },
113
+ is_validated=False,
114
+ used_in_level_2=True,
115
+ ),
116
+ # Filter asset list
117
+ FilterAssetListTask(
118
+ is_validated=True,
119
+ list_name="alm_asset",
120
+ used_in_level_2=True,
121
+ fixed_config=filter_config,
122
+ ),
123
+ ]
124
+
125
+ self.compositional_task = filter_asset_list_subtask
126
+
127
+ def setup_goal(self, page: Page) -> tuple[str, dict]:
128
+ self.create_report()
129
+
130
+ # We create dummy assets for the consumable and license categories here
131
+ ### NOTE: We can create assets without any of the following information, save time, and still assign them to the user. The task should be fine.
132
+ consumable_category_sysid = table_api_call(
133
+ instance=self.instance,
134
+ table="cmdb_model_category",
135
+ method="GET",
136
+ params={"sysparm_query": "asset_class=alm_consumable", "sysparm_fields": "sys_id"},
137
+ )["result"][0]["sys_id"]
138
+
139
+ consumables = table_api_call(
140
+ instance=self.instance,
141
+ table="cmdb_model",
142
+ method="GET",
143
+ params={
144
+ "sysparm_query": f"cmdb_model_category={consumable_category_sysid}",
145
+ "sysparm_fields": "sys_id",
146
+ },
147
+ )["result"]
148
+ consumables_sysids = [consumable["sys_id"] for consumable in consumables]
149
+
150
+ license_category_sysid = table_api_call(
151
+ instance=self.instance,
152
+ table="cmdb_model_category",
153
+ method="GET",
154
+ params={"sysparm_query": "asset_class=alm_license", "sysparm_fields": "sys_id"},
155
+ )["result"][0]["sys_id"]
156
+
157
+ licenses = table_api_call(
158
+ instance=self.instance,
159
+ table="cmdb_model",
160
+ method="GET",
161
+ params={
162
+ "sysparm_query": f"cmdb_model_category={license_category_sysid}",
163
+ "sysparm_fields": "sys_id",
164
+ },
165
+ )["result"][:10]
166
+ license_sysids = [license["sys_id"] for license in licenses]
167
+
168
+ self.new_asset_sys_ids = []
169
+ for agent_sysid in self.agent_sysids:
170
+ num_assets = self.random.choice(range(1, self.max_assets_per_agent))
171
+ for _ in range(num_assets):
172
+ consumable_asset_data = {
173
+ "asset_tag": "CONSUMABLE" + str(random.randint(100, 999)),
174
+ "model": self.random.choice(consumables_sysids),
175
+ "model_category": consumable_category_sysid,
176
+ "assigned_to": agent_sysid,
177
+ "cost": 1000.00,
178
+ "purchase_date": "2024-05-08",
179
+ "substatus": "in_use",
180
+ }
181
+ response = table_api_call(
182
+ instance=self.instance,
183
+ table="alm_asset",
184
+ json=consumable_asset_data,
185
+ method="POST",
186
+ )
187
+ self.new_asset_sys_ids.append(response["result"]["sys_id"])
188
+ license_asset_data = {
189
+ "asset_tag": "LICENSE" + str(random.randint(100, 999)),
190
+ "model": self.random.choice(license_sysids),
191
+ "model_category": license_category_sysid,
192
+ "assigned_to": agent_sysid,
193
+ "cost": 1000.00,
194
+ "purchase_date": "2024-05-08",
195
+ "substatus": "in_use",
196
+ }
197
+ response = table_api_call(
198
+ instance=self.instance,
199
+ table="alm_asset",
200
+ json=license_asset_data,
201
+ method="POST",
202
+ )
203
+ self.new_asset_sys_ids.append(response["result"]["sys_id"])
204
+
205
+ self.set_compositional_task()
206
+ config = self.fixed_config if self.fixed_config else self._get_config()
207
+
208
+ if self.level == 3:
209
+ filter_than = f"{self.filter_than} than or " if self.filter_than else ""
210
+ self.task_description = (
211
+ self.task_description
212
+ + f"\t - Please retrieve the '{self.description_mapping[self.question]}' value of the number of incidents assigned across agents. Retrieve agents that have {filter_than}equal number of incidents assigned to them compared to this value.\n"
213
+ + f"\t For example, if you were asked to find the 'mean' or 'average' for a case where there are 4 agents assigned 1,2,3,2 incidents respectively, the mean would be 2. The list of agents required for solving the following task would be all the agents that have {filter_than}equal to 2 assigned incidents.\n\n"
214
+ + f"\t - Task: Filter the Asset List using the {self.attribute_name} field corresponding to the agents that fit the criteria above. \n"
215
+ + f"The list is present at Portfolios > All Assets. \n\n"
216
+ + self.final_private_task_instructions
217
+ )
218
+
219
+ goal, info = super().setup_goal(
220
+ page=page, config=config, build_pretty_print_description=False
221
+ )
222
+
223
+ if self.level == 2:
224
+ if self.filter_than:
225
+ step_3 = f"\n3. Find the agents with number of incidents {self.filter_than} than or equal to the {self.description_mapping[self.question]} value of the number of incidents assigned across agents. \n"
226
+ else:
227
+ step_3 = f"\n3. Find the agent with the {self.description_mapping[self.question]} assigned incidents. \n"
228
+ goal = (
229
+ self.short_description
230
+ + f"\n1. Navigate to the Reports > View/Run page. \n"
231
+ + f"\n2. Given the title of the report, search for it on this page. The report shows the number of 'incidents' assigned to an 'agent'.\n"
232
+ + step_3
233
+ + f"\n4. Navigate to Portfolios > All Assets. \n"
234
+ + f"\nUsing the field {self.attribute_name} for the agent/ agents that fit the critera above, filter the list.\n"
235
+ )
236
+
237
+ return goal, info
238
+
239
+ def teardown(self) -> None:
240
+ # Delete all assets
241
+ for new_asset_sysid in self.new_asset_sys_ids:
242
+ db_delete_from_table(
243
+ instance=self.instance,
244
+ table="alm_asset",
245
+ sys_id=new_asset_sysid,
246
+ )
247
+ return super().teardown()
248
+
249
+
250
+ class DashboardRetrieveIncidentAndFilterHardwareListTask(
251
+ DashboardRetrieveIncidentAndFilterListTask
252
+ ):
253
+ def __init__(
254
+ self,
255
+ instance: SNowInstance = None,
256
+ seed: int = None,
257
+ fixed_config: list[AbstractServiceNowTask] = None,
258
+ level: int = 2,
259
+ max_assets_per_agent: int = 2,
260
+ question: str = None,
261
+ dashboard_class: AbstractServiceNowTask = None,
262
+ ) -> None:
263
+ """
264
+ Retrieve the best or worst performing agent and filter a hardware list based on their assignments.
265
+ Attributes:
266
+ -----------
267
+ task_description: str
268
+ The start of the task description to be completed.
269
+ short_description: str
270
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a hardware list based on their assignments."
271
+ """
272
+ self.max_assets_per_agent = max_assets_per_agent
273
+ self.attribute_name = "assigned_to"
274
+ super().__init__(
275
+ instance=instance,
276
+ seed=seed,
277
+ fixed_config=fixed_config,
278
+ level=level,
279
+ question=question,
280
+ dashboard_class=dashboard_class,
281
+ )
282
+
283
+ def set_compositional_task(self) -> None:
284
+
285
+ filter_config = self.get_filter_config(
286
+ attribute_name=self.attribute_name, filter_than=self.filter_than
287
+ )
288
+
289
+ filter_hardware_asset_list_subtask = [
290
+ # Navigate to the hardware asset list
291
+ AllMenuTask(
292
+ instance=self.instance,
293
+ fixed_config={
294
+ "application": "Asset",
295
+ "module": "Portfolios > Hardware Assets",
296
+ "url": "/now/nav/ui/classic/params/target/alm_hardware_list.do",
297
+ },
298
+ is_validated=False,
299
+ used_in_level_2=True,
300
+ ),
301
+ # Filter hardware list
302
+ FilterHardwareListTask(
303
+ is_validated=True,
304
+ list_name="alm_hardware",
305
+ used_in_level_2=True,
306
+ fixed_config=filter_config,
307
+ ),
308
+ ]
309
+
310
+ self.compositional_task = filter_hardware_asset_list_subtask
311
+
312
+ def setup_goal(self, page: Page) -> tuple[str, dict]:
313
+ self.create_report()
314
+
315
+ hardware_category_sysid = table_api_call(
316
+ instance=self.instance,
317
+ table="cmdb_model_category",
318
+ method="GET",
319
+ params={"sysparm_query": "asset_class=alm_hardware", "sysparm_fields": "sys_id"},
320
+ )["result"][0]["sys_id"]
321
+
322
+ hardwares = table_api_call(
323
+ instance=self.instance,
324
+ table="cmdb_model",
325
+ method="GET",
326
+ params={
327
+ "sysparm_query": f"cmdb_model_category={hardware_category_sysid}",
328
+ "sysparm_fields": "sys_id",
329
+ },
330
+ )["result"]
331
+ hardware_sysids = [hardware["sys_id"] for hardware in hardwares]
332
+ self.new_asset_sysids = []
333
+ for agent_sysid in self.agent_sysids:
334
+ num_assets = self.random.choice(range(1, self.max_assets_per_agent))
335
+ for _ in range(num_assets):
336
+ hardware_asset_data = {
337
+ "asset_tag": "CONSUMABLE" + str(random.randint(100, 999)),
338
+ "model": self.random.choice(hardware_sysids),
339
+ "model_category": hardware_category_sysid,
340
+ "assigned_to": agent_sysid,
341
+ "cost": 1000.00,
342
+ "purchase_date": "2024-05-08",
343
+ "substatus": "in_use",
344
+ }
345
+ response = table_api_call(
346
+ instance=self.instance,
347
+ table="alm_hardware",
348
+ json=hardware_asset_data,
349
+ method="POST",
350
+ )
351
+ self.new_asset_sysids.append(response["result"]["sys_id"])
352
+
353
+ self.set_compositional_task()
354
+ config = self.fixed_config if self.fixed_config else self._get_config()
355
+
356
+ if self.level == 3:
357
+ filter_than = f"{self.filter_than} than or " if self.filter_than else ""
358
+ self.task_description = (
359
+ self.task_description
360
+ + f"\t - Please retrieve the '{self.description_mapping[self.question]}' value of the number of incidents assigned across agents. Retrieve agents that have {filter_than}equal number of incidents assigned to them compared to this value.\n"
361
+ + f"\t For example, if you were asked to find the 'mean' or 'average' for a case where there are 4 agents assigned 1,2,3,2 incidents respectively, the mean would be 2. The list of agents required for solving the following task would be all the agents that have {filter_than}equal to 2 assigned incidents.\n\n"
362
+ + f"\t - Task: Filter the Hardware List using the {self.attribute_name} field corresponding to the agents that fit the criteria above. \n"
363
+ + f"The list is present at Portfolios > Hardware Assets. \n\n"
364
+ + self.final_private_task_instructions
365
+ )
366
+
367
+ goal, info = super().setup_goal(
368
+ page=page, config=config, build_pretty_print_description=False
369
+ )
370
+
371
+ if self.level == 2:
372
+ if self.filter_than:
373
+ step_3 = f"\n3. Find the agents with number of incidents {self.filter_than} than or equal to the {self.description_mapping[self.question]} value of the number of incidents assigned across agents. \n"
374
+ else:
375
+ step_3 = f"\n3. Find the agent with the {self.description_mapping[self.question]} assigned incidents. \n"
376
+ goal = (
377
+ self.short_description
378
+ + f"\n1. Navigate to the Reports > View/Run page. \n"
379
+ + f"\n2. Given the title of the report, search for it on this page. The report shows the number of 'incidents' assigned to an 'agent'.\n"
380
+ + step_3
381
+ + f"\n4. Navigate to Portfolios > Hardware Assets. \n"
382
+ + f"\nUsing the field {self.attribute_name} for the agent/ agents that fit the critera above, filter the list.\n"
383
+ )
384
+
385
+ return goal, info
386
+
387
+ def teardown(self) -> None:
388
+ # Delete all assets
389
+ for new_asset_sysid in self.new_asset_sysids:
390
+ db_delete_from_table(
391
+ instance=self.instance,
392
+ table="alm_hardware",
393
+ sys_id=new_asset_sysid,
394
+ )
395
+ return super().teardown()
396
+
397
+
398
+ class DashboardRetrieveIncidentAndFilterIncidentListTask(
399
+ DashboardRetrieveIncidentAndFilterListTask
400
+ ):
401
+ def __init__(
402
+ self,
403
+ instance: SNowInstance = None,
404
+ seed: int = None,
405
+ fixed_config: list[AbstractServiceNowTask] = None,
406
+ level: int = 2,
407
+ question: str = None,
408
+ dashboard_class: AbstractServiceNowTask = None,
409
+ ) -> None:
410
+ """
411
+ Retrieve the best or worst performing agent and filter an incident list based on their assignments.
412
+ Attributes:
413
+ -----------
414
+ task_description: str
415
+ The start of the task description to be completed.
416
+ short_description: str
417
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter an incident list based on their assignments."
418
+ """
419
+ self.attribute_name = "assigned_to"
420
+ super().__init__(
421
+ instance=instance,
422
+ seed=seed,
423
+ fixed_config=fixed_config,
424
+ level=level,
425
+ question=question,
426
+ dashboard_class=dashboard_class,
427
+ )
428
+
429
+ def set_compositional_task(self) -> None:
430
+
431
+ filter_config = self.get_filter_config(
432
+ attribute_name=self.attribute_name, filter_than=self.filter_than
433
+ )
434
+
435
+ filter_incident_list_subtask = [
436
+ # Navigate to the incident list
437
+ AllMenuTask(
438
+ instance=self.instance,
439
+ fixed_config={
440
+ "application": "Service Desk",
441
+ "module": "Incidents",
442
+ "url": "/now/nav/ui/classic/params/target/incident_list.do",
443
+ },
444
+ is_validated=False,
445
+ used_in_level_2=True,
446
+ ),
447
+ # Filter incident list
448
+ FilterIncidentListTask(
449
+ is_validated=True,
450
+ list_name="incident",
451
+ used_in_level_2=True,
452
+ fixed_config=filter_config,
453
+ ),
454
+ ]
455
+
456
+ self.compositional_task = filter_incident_list_subtask
457
+
458
+ def setup_goal(self, page: Page) -> tuple[str, dict]:
459
+ self.create_report()
460
+ self.set_compositional_task()
461
+ config = self.fixed_config if self.fixed_config else self._get_config()
462
+
463
+ if self.level == 3:
464
+ filter_than = f"{self.filter_than} than or " if self.filter_than else ""
465
+ self.task_description = (
466
+ self.task_description
467
+ + f"\t - Please retrieve the '{self.description_mapping[self.question]}' value of the number of incidents assigned across agents. Retrieve agents that have {filter_than}equal number of incidents assigned to them compared to this value.\n"
468
+ + f"\t For example, if you were asked to find the 'mean' or 'average' for a case where there are 4 agents assigned 1,2,3,2 incidents respectively, the mean would be 2. The list of agents required for solving the following task would be all the agents that have {filter_than}equal to 2 assigned incidents.\n\n"
469
+ + f"\t - Task: Filter the Incident List using the {self.attribute_name} field corresponding to the agents that fit the criteria above. \n"
470
+ + f"The list is present at Service Desk > Incidents. \n\n"
471
+ + self.final_private_task_instructions
472
+ )
473
+
474
+ goal, info = super().setup_goal(
475
+ page=page, config=config, build_pretty_print_description=False
476
+ )
477
+
478
+ if self.level == 2:
479
+ if self.filter_than:
480
+ step_3 = f"\n3. Find the agents with number of incidents {self.filter_than} than or equal to the {self.description_mapping[self.question]} value of the number of incidents assigned across agents. \n"
481
+ else:
482
+ step_3 = f"\n3. Find the agent with the {self.description_mapping[self.question]} assigned incidents. \n"
483
+ goal = (
484
+ self.short_description
485
+ + f"\n1. Navigate to the Reports > View/Run page. \n"
486
+ + f"\n2. Given the title of the report, search for it on this page. The report shows the number of 'incidents' assigned to an 'agent'.\n"
487
+ + step_3
488
+ + f"\n4. Navigate to Service Desk > Incidents. \n"
489
+ + f"\nUsing the field {self.attribute_name} for the agent/ agents that fit the critera above, filter the list.\n"
490
+ )
491
+
492
+ return goal, info
493
+
494
+
495
+ class DashboardRetrieveIncidentAndFilterUserListTask(DashboardRetrieveIncidentAndFilterListTask):
496
+ def __init__(
497
+ self,
498
+ instance: SNowInstance = None,
499
+ seed: int = None,
500
+ fixed_config: list[AbstractServiceNowTask] = None,
501
+ level: int = 2,
502
+ question: str = None,
503
+ dashboard_class: AbstractServiceNowTask = None,
504
+ ) -> None:
505
+ """
506
+ Retrieve the best or worst performing agent and filter a user list based on their assignments.
507
+ Attributes:
508
+ -----------
509
+ task_description: str
510
+ The start of the task description to be completed.
511
+ short_description: str
512
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a user list based on their assignments."
513
+ """
514
+ self.attribute_name = "first_name"
515
+ super().__init__(
516
+ instance=instance,
517
+ seed=seed,
518
+ fixed_config=fixed_config,
519
+ level=level,
520
+ question=question,
521
+ dashboard_class=dashboard_class,
522
+ )
523
+
524
+ def set_compositional_task(self) -> None:
525
+ filter_config = self.get_filter_config(
526
+ attribute_name=self.attribute_name, filter_than=self.filter_than
527
+ )
528
+
529
+ filter_user_list_subtask = [
530
+ # Navigate to the user list
531
+ AllMenuTask(
532
+ instance=self.instance,
533
+ fixed_config={
534
+ "application": "Organization",
535
+ "module": "Users",
536
+ "url": "/now/nav/ui/classic/params/target/sys_user_list.do",
537
+ },
538
+ is_validated=False,
539
+ used_in_level_2=True,
540
+ ),
541
+ # Filter user list
542
+ FilterUserListTask(
543
+ is_validated=True,
544
+ list_name="user",
545
+ used_in_level_2=True,
546
+ fixed_config=filter_config,
547
+ ),
548
+ ]
549
+
550
+ self.compositional_task = filter_user_list_subtask
551
+
552
+ def setup_goal(self, page: Page) -> tuple[str, dict]:
553
+ self.create_report()
554
+ self.set_compositional_task()
555
+ config = self.fixed_config if self.fixed_config else self._get_config()
556
+
557
+ if self.level == 3:
558
+ filter_than = f"{self.filter_than} than or " if self.filter_than else ""
559
+ self.task_description = (
560
+ self.task_description
561
+ + f"\t - Please retrieve the '{self.description_mapping[self.question]}' value of the number of incidents assigned across agents. Retrieve agents that have {filter_than}equal number of incidents assigned to them compared to this value.\n"
562
+ + f"\t For example, if you were asked to find the 'mean' or 'average' for a case where there are 4 agents assigned 1,2,3,2 incidents respectively, the mean would be 2. The list of agents required for solving the following task would be all the agents that have {filter_than}equal to 2 assigned incidents.\n\n"
563
+ + f"\t - Task: Filter the User List using the {self.attribute_name} field corresponding to the agents that fit the criteria above. \n"
564
+ + f"The list is present at Organization > Users. \n\n"
565
+ + self.final_private_task_instructions
566
+ )
567
+
568
+ goal, info = super().setup_goal(
569
+ page=page, config=config, build_pretty_print_description=False
570
+ )
571
+
572
+ if self.level == 2:
573
+ if self.filter_than:
574
+ step_3 = f"3. Find the agents with number of incidents {self.filter_than} than or equal to the {self.description_mapping[self.question]} value of the number of incidents assigned across agents. \n"
575
+ else:
576
+ step_3 = f"3. Find the agent with the {self.description_mapping[self.question]} assigned incidents. \n"
577
+ goal = (
578
+ self.short_description
579
+ + f"\n1. Navigate to the Reports > View/Run page. \n"
580
+ + f"\n2. Given the title of the report, search for it on this page. The report shows the number of 'incidents' assigned to an 'agent'.\n"
581
+ + step_3
582
+ + f"\n4. Navigate to Organization > Users. \n"
583
+ + f"\nUsing the field {self.attribute_name} for the agent/ agents that fit the critera above, filter the list.\n"
584
+ )
585
+
586
+ return goal, info
587
+
588
+
589
+ class DashboardRetrieveIncidentAndMaxFilterAssetListTask(
590
+ DashboardRetrieveIncidentAndFilterAssetListTask, DashDoFinalTask
591
+ ):
592
+ def __init__(
593
+ self,
594
+ instance: SNowInstance = None,
595
+ seed: int = None,
596
+ fixed_config: list[AbstractServiceNowTask] = None,
597
+ level: int = 2,
598
+ ) -> None:
599
+ """
600
+ Retrieve the best or worst performing agent and filter an asset list based on their assignments.
601
+ Attributes:
602
+ -----------
603
+ task_description: str
604
+ The start of the task description to be completed.
605
+ short_description: str
606
+ A short description of the task to be completed. "Filter the asset list based on incidents assigned to an employee"
607
+ """
608
+ self.filter_than = None
609
+ super().__init__(
610
+ instance=instance,
611
+ seed=seed,
612
+ fixed_config=fixed_config,
613
+ level=level,
614
+ question="max",
615
+ dashboard_class=SingleChartMinMaxRetrievalTask,
616
+ )
617
+
618
+
619
+ class DashboardRetrieveIncidentAndMinFilterAssetListTask(
620
+ DashboardRetrieveIncidentAndFilterAssetListTask, DashDoFinalTask
621
+ ):
622
+ def __init__(
623
+ self,
624
+ instance: SNowInstance = None,
625
+ seed: int = None,
626
+ fixed_config: list[AbstractServiceNowTask] = None,
627
+ level: int = 2,
628
+ ) -> None:
629
+ """
630
+ Retrieve the best or worst performing agent and filter an asset list based on their assignments.
631
+ Attributes:
632
+ -----------
633
+ task_description: str
634
+ The start of the task description to be completed.
635
+ short_description: str
636
+ A short description of the task to be completed. "Filter the asset list based on incidents assigned to an employee"
637
+ """
638
+ self.filter_than = None
639
+ super().__init__(
640
+ instance=instance,
641
+ seed=seed,
642
+ fixed_config=fixed_config,
643
+ level=level,
644
+ question="min",
645
+ dashboard_class=SingleChartMinMaxRetrievalTask,
646
+ )
647
+
648
+
649
+ class DashboardRetrieveIncidentAndMeanGreaterFilterAssetListTask(
650
+ DashboardRetrieveIncidentAndFilterAssetListTask, DashDoFinalTask
651
+ ):
652
+ def __init__(
653
+ self,
654
+ instance: SNowInstance = None,
655
+ seed: int = None,
656
+ fixed_config: list[AbstractServiceNowTask] = None,
657
+ level: int = 2,
658
+ ) -> None:
659
+ """
660
+ Retrieve the best or worst performing agent and filter an asset list based on their assignments.
661
+ Attributes:
662
+ -----------
663
+ task_description: str
664
+ The start of the task description to be completed.
665
+ short_description: str
666
+ A short description of the task to be completed. "Filter the asset list based on incidents assigned to an employee"
667
+ """
668
+ self.filter_than = "greater"
669
+ super().__init__(
670
+ instance=instance,
671
+ seed=seed,
672
+ fixed_config=fixed_config,
673
+ level=level,
674
+ question="mean",
675
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
676
+ )
677
+
678
+
679
+ class DashboardRetrieveIncidentAndMedianGreaterFilterAssetListTask(
680
+ DashboardRetrieveIncidentAndFilterAssetListTask, DashDoFinalTask
681
+ ):
682
+ def __init__(
683
+ self,
684
+ instance: SNowInstance = None,
685
+ seed: int = None,
686
+ fixed_config: list[AbstractServiceNowTask] = None,
687
+ level: int = 2,
688
+ ) -> None:
689
+ """
690
+ Retrieve the best or worst performing agent and filter an asset list based on their assignments.
691
+ Attributes:
692
+ -----------
693
+ task_description: str
694
+ The start of the task description to be completed.
695
+ short_description: str
696
+ A short description of the task to be completed. "Filter the asset list based on incidents assigned to an employee"
697
+ """
698
+ self.filter_than = "greater"
699
+ super().__init__(
700
+ instance=instance,
701
+ seed=seed,
702
+ fixed_config=fixed_config,
703
+ level=level,
704
+ question="median",
705
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
706
+ )
707
+
708
+
709
+ class DashboardRetrieveIncidentAndModeGreaterFilterAssetListTask(
710
+ DashboardRetrieveIncidentAndFilterAssetListTask, DashDoFinalTask
711
+ ):
712
+ def __init__(
713
+ self,
714
+ instance: SNowInstance = None,
715
+ seed: int = None,
716
+ fixed_config: list[AbstractServiceNowTask] = None,
717
+ level: int = 2,
718
+ ) -> None:
719
+ """
720
+ Retrieve the best or worst performing agent and filter an asset list based on their assignments.
721
+ Attributes:
722
+ -----------
723
+ task_description: str
724
+ The start of the task description to be completed.
725
+ short_description: str
726
+ A short description of the task to be completed. "Filter the asset list based on incidents assigned to an employee"
727
+ """
728
+ self.filter_than = "greater"
729
+ super().__init__(
730
+ instance=instance,
731
+ seed=seed,
732
+ fixed_config=fixed_config,
733
+ level=level,
734
+ question="mode",
735
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
736
+ )
737
+
738
+
739
+ class DashboardRetrieveIncidentAndMeanLesserFilterAssetListTask(
740
+ DashboardRetrieveIncidentAndFilterAssetListTask, DashDoFinalTask
741
+ ):
742
+ def __init__(
743
+ self,
744
+ instance: SNowInstance = None,
745
+ seed: int = None,
746
+ fixed_config: list[AbstractServiceNowTask] = None,
747
+ level: int = 2,
748
+ ) -> None:
749
+ """
750
+ Retrieve the best or worst performing agent and filter an asset list based on their assignments.
751
+ Attributes:
752
+ -----------
753
+ task_description: str
754
+ The start of the task description to be completed.
755
+ short_description: str
756
+ A short description of the task to be completed. "Filter the asset list based on incidents assigned to an employee"
757
+ """
758
+ self.filter_than = "lesser"
759
+ super().__init__(
760
+ instance=instance,
761
+ seed=seed,
762
+ fixed_config=fixed_config,
763
+ level=level,
764
+ question="mean",
765
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
766
+ )
767
+
768
+
769
+ class DashboardRetrieveIncidentAndMedianLesserFilterAssetListTask(
770
+ DashboardRetrieveIncidentAndFilterAssetListTask, DashDoFinalTask
771
+ ):
772
+ def __init__(
773
+ self,
774
+ instance: SNowInstance = None,
775
+ seed: int = None,
776
+ fixed_config: list[AbstractServiceNowTask] = None,
777
+ level: int = 2,
778
+ ) -> None:
779
+ """
780
+ Retrieve the best or worst performing agent and filter an asset list based on their assignments.
781
+ Attributes:
782
+ -----------
783
+ task_description: str
784
+ The start of the task description to be completed.
785
+ short_description: str
786
+ A short description of the task to be completed. "Filter the asset list based on incidents assigned to an employee"
787
+ """
788
+ self.filter_than = "lesser"
789
+ super().__init__(
790
+ instance=instance,
791
+ seed=seed,
792
+ fixed_config=fixed_config,
793
+ level=level,
794
+ question="median",
795
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
796
+ )
797
+
798
+
799
+ class DashboardRetrieveIncidentAndModeLesserFilterAssetListTask(
800
+ DashboardRetrieveIncidentAndFilterAssetListTask, DashDoFinalTask
801
+ ):
802
+ def __init__(
803
+ self,
804
+ instance: SNowInstance = None,
805
+ seed: int = None,
806
+ fixed_config: list[AbstractServiceNowTask] = None,
807
+ level: int = 2,
808
+ ) -> None:
809
+ """
810
+ Retrieve the best or worst performing agent and filter an asset list based on their assignments.
811
+ Attributes:
812
+ -----------
813
+ task_description: str
814
+ The start of the task description to be completed.
815
+ short_description: str
816
+ A short description of the task to be completed. "Filter the asset list based on incidents assigned to an employee"
817
+ """
818
+ self.filter_than = "lesser"
819
+ super().__init__(
820
+ instance=instance,
821
+ seed=seed,
822
+ fixed_config=fixed_config,
823
+ level=level,
824
+ question="mode",
825
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
826
+ )
827
+
828
+
829
+ class DashboardRetrieveIncidentAndMaxFilterHardwareListTask(
830
+ DashboardRetrieveIncidentAndFilterHardwareListTask, DashDoFinalTask
831
+ ):
832
+ def __init__(
833
+ self,
834
+ instance: SNowInstance = None,
835
+ seed: int = None,
836
+ fixed_config: list[AbstractServiceNowTask] = None,
837
+ level: int = 2,
838
+ ) -> None:
839
+ """
840
+ Retrieve the best or worst performing agent and filter a hardware list based on their assignments.
841
+ Attributes:
842
+ -----------
843
+ task_description: str
844
+ The start of the task description to be completed.
845
+ short_description: str
846
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a hardware list based on their assignments."
847
+ """
848
+ self.filter_than = None
849
+ super().__init__(
850
+ instance=instance,
851
+ seed=seed,
852
+ fixed_config=fixed_config,
853
+ level=level,
854
+ question="max",
855
+ dashboard_class=SingleChartMinMaxRetrievalTask,
856
+ )
857
+
858
+
859
+ class DashboardRetrieveIncidentAndMinFilterHardwareListTask(
860
+ DashboardRetrieveIncidentAndFilterHardwareListTask, DashDoFinalTask
861
+ ):
862
+ def __init__(
863
+ self,
864
+ instance: SNowInstance = None,
865
+ seed: int = None,
866
+ fixed_config: list[AbstractServiceNowTask] = None,
867
+ level: int = 2,
868
+ ) -> None:
869
+ """
870
+ Retrieve the best or worst performing agent and filter a hardware list based on their assignments.
871
+ Attributes:
872
+ -----------
873
+ task_description: str
874
+ The start of the task description to be completed.
875
+ short_description: str
876
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a hardware list based on their assignments."
877
+ """
878
+ self.filter_than = None
879
+ super().__init__(
880
+ instance=instance,
881
+ seed=seed,
882
+ fixed_config=fixed_config,
883
+ level=level,
884
+ question="min",
885
+ dashboard_class=SingleChartMinMaxRetrievalTask,
886
+ )
887
+
888
+
889
+ class DashboardRetrieveIncidentAndMeanGreaterFilterHardwareListTask(
890
+ DashboardRetrieveIncidentAndFilterHardwareListTask, DashDoFinalTask
891
+ ):
892
+ def __init__(
893
+ self,
894
+ instance: SNowInstance = None,
895
+ seed: int = None,
896
+ fixed_config: list[AbstractServiceNowTask] = None,
897
+ level: int = 2,
898
+ ) -> None:
899
+ """
900
+ Retrieve the best or worst performing agent and filter a hardware list based on their assignments.
901
+ Attributes:
902
+ -----------
903
+ task_description: str
904
+ The start of the task description to be completed.
905
+ short_description: str
906
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a hardware list based on their assignments."
907
+ """
908
+ self.filter_than = "greater"
909
+ super().__init__(
910
+ instance=instance,
911
+ seed=seed,
912
+ fixed_config=fixed_config,
913
+ level=level,
914
+ question="mean",
915
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
916
+ )
917
+
918
+
919
+ class DashboardRetrieveIncidentAndMedianGreaterFilterHardwareListTask(
920
+ DashboardRetrieveIncidentAndFilterHardwareListTask, DashDoFinalTask
921
+ ):
922
+ def __init__(
923
+ self,
924
+ instance: SNowInstance = None,
925
+ seed: int = None,
926
+ fixed_config: list[AbstractServiceNowTask] = None,
927
+ level: int = 2,
928
+ ) -> None:
929
+ """
930
+ Retrieve the best or worst performing agent and filter a hardware list based on their assignments.
931
+ Attributes:
932
+ -----------
933
+ task_description: str
934
+ The start of the task description to be completed.
935
+ short_description: str
936
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a hardware list based on their assignments."
937
+ """
938
+ self.filter_than = "greater"
939
+ super().__init__(
940
+ instance=instance,
941
+ seed=seed,
942
+ fixed_config=fixed_config,
943
+ level=level,
944
+ question="median",
945
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
946
+ )
947
+
948
+
949
+ class DashboardRetrieveIncidentAndModeGreaterFilterHardwareListTask(
950
+ DashboardRetrieveIncidentAndFilterHardwareListTask, DashDoFinalTask
951
+ ):
952
+ def __init__(
953
+ self,
954
+ instance: SNowInstance = None,
955
+ seed: int = None,
956
+ fixed_config: list[AbstractServiceNowTask] = None,
957
+ level: int = 2,
958
+ ) -> None:
959
+ """
960
+ Retrieve the best or worst performing agent and filter a hardware list based on their assignments.
961
+ Attributes:
962
+ -----------
963
+ task_description: str
964
+ The start of the task description to be completed.
965
+ short_description: str
966
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a hardware list based on their assignments."
967
+ """
968
+ self.filter_than = "greater"
969
+ super().__init__(
970
+ instance=instance,
971
+ seed=seed,
972
+ fixed_config=fixed_config,
973
+ level=level,
974
+ question="mode",
975
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
976
+ )
977
+
978
+
979
+ class DashboardRetrieveIncidentAndMeanLesserFilterHardwareListTask(
980
+ DashboardRetrieveIncidentAndFilterHardwareListTask, DashDoFinalTask
981
+ ):
982
+ def __init__(
983
+ self,
984
+ instance: SNowInstance = None,
985
+ seed: int = None,
986
+ fixed_config: list[AbstractServiceNowTask] = None,
987
+ level: int = 2,
988
+ ) -> None:
989
+ """
990
+ Retrieve the best or worst performing agent and filter a hardware list based on their assignments.
991
+ Attributes:
992
+ -----------
993
+ task_description: str
994
+ The start of the task description to be completed.
995
+ short_description: str
996
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a hardware list based on their assignments."
997
+ """
998
+ self.filter_than = "lesser"
999
+ super().__init__(
1000
+ instance=instance,
1001
+ seed=seed,
1002
+ fixed_config=fixed_config,
1003
+ level=level,
1004
+ question="mean",
1005
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1006
+ )
1007
+
1008
+
1009
+ class DashboardRetrieveIncidentAndMedianLesserFilterHardwareListTask(
1010
+ DashboardRetrieveIncidentAndFilterHardwareListTask, DashDoFinalTask
1011
+ ):
1012
+ def __init__(
1013
+ self,
1014
+ instance: SNowInstance = None,
1015
+ seed: int = None,
1016
+ fixed_config: list[AbstractServiceNowTask] = None,
1017
+ level: int = 2,
1018
+ ) -> None:
1019
+ """
1020
+ Retrieve the best or worst performing agent and filter a hardware list based on their assignments.
1021
+ Attributes:
1022
+ -----------
1023
+ task_description: str
1024
+ The start of the task description to be completed.
1025
+ short_description: str
1026
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a hardware list based on their assignments."
1027
+ """
1028
+ self.filter_than = "lesser"
1029
+ super().__init__(
1030
+ instance=instance,
1031
+ seed=seed,
1032
+ fixed_config=fixed_config,
1033
+ level=level,
1034
+ question="median",
1035
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1036
+ )
1037
+
1038
+
1039
+ class DashboardRetrieveIncidentAndModeLesserFilterHardwareListTask(
1040
+ DashboardRetrieveIncidentAndFilterHardwareListTask, DashDoFinalTask
1041
+ ):
1042
+ def __init__(
1043
+ self,
1044
+ instance: SNowInstance = None,
1045
+ seed: int = None,
1046
+ fixed_config: list[AbstractServiceNowTask] = None,
1047
+ level: int = 2,
1048
+ ) -> None:
1049
+ """
1050
+ Retrieve the best or worst performing agent and filter a hardware list based on their assignments.
1051
+ Attributes:
1052
+ -----------
1053
+ task_description: str
1054
+ The start of the task description to be completed.
1055
+ short_description: str
1056
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a hardware list based on their assignments."
1057
+ """
1058
+ self.filter_than = "lesser"
1059
+ super().__init__(
1060
+ instance=instance,
1061
+ seed=seed,
1062
+ fixed_config=fixed_config,
1063
+ level=level,
1064
+ question="mode",
1065
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1066
+ )
1067
+
1068
+
1069
+ class DashboardRetrieveIncidentAndMaxFilterIncidentListTask(
1070
+ DashboardRetrieveIncidentAndFilterIncidentListTask, DashDoFinalTask
1071
+ ):
1072
+ def __init__(
1073
+ self,
1074
+ instance: SNowInstance = None,
1075
+ seed: int = None,
1076
+ fixed_config: list[AbstractServiceNowTask] = None,
1077
+ level: int = 2,
1078
+ ) -> None:
1079
+ """
1080
+ Retrieve the best or worst performing agent and filter an incident list based on their assignments.
1081
+ Attributes:
1082
+ -----------
1083
+ task_description: str
1084
+ The start of the task description to be completed.
1085
+ short_description: str
1086
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter an incident list based on their assignments."
1087
+ """
1088
+ self.filter_than = None
1089
+ super().__init__(
1090
+ instance=instance,
1091
+ seed=seed,
1092
+ fixed_config=fixed_config,
1093
+ level=level,
1094
+ question="max",
1095
+ dashboard_class=SingleChartMinMaxRetrievalTask,
1096
+ )
1097
+
1098
+
1099
+ class DashboardRetrieveIncidentAndMinFilterIncidentListTask(
1100
+ DashboardRetrieveIncidentAndFilterIncidentListTask, DashDoFinalTask
1101
+ ):
1102
+ def __init__(
1103
+ self,
1104
+ instance: SNowInstance = None,
1105
+ seed: int = None,
1106
+ fixed_config: list[AbstractServiceNowTask] = None,
1107
+ level: int = 2,
1108
+ ) -> None:
1109
+ """
1110
+ Retrieve the best or worst performing agent and filter an incident list based on their assignments.
1111
+ Attributes:
1112
+ -----------
1113
+ task_description: str
1114
+ The start of the task description to be completed.
1115
+ short_description: str
1116
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter an incident list based on their assignments."
1117
+ """
1118
+ self.filter_than = None
1119
+ super().__init__(
1120
+ instance=instance,
1121
+ seed=seed,
1122
+ fixed_config=fixed_config,
1123
+ level=level,
1124
+ question="min",
1125
+ dashboard_class=SingleChartMinMaxRetrievalTask,
1126
+ )
1127
+
1128
+
1129
+ class DashboardRetrieveIncidentAndMeanGreaterFilterIncidentListTask(
1130
+ DashboardRetrieveIncidentAndFilterIncidentListTask, DashDoFinalTask
1131
+ ):
1132
+ def __init__(
1133
+ self,
1134
+ instance: SNowInstance = None,
1135
+ seed: int = None,
1136
+ fixed_config: list[AbstractServiceNowTask] = None,
1137
+ level: int = 2,
1138
+ ) -> None:
1139
+ """
1140
+ Retrieve the best or worst performing agent and filter an incident list based on their assignments.
1141
+ Attributes:
1142
+ -----------
1143
+ task_description: str
1144
+ The start of the task description to be completed.
1145
+ short_description: str
1146
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter an incident list based on their assignments."
1147
+ """
1148
+ self.filter_than = "greater"
1149
+ super().__init__(
1150
+ instance=instance,
1151
+ seed=seed,
1152
+ fixed_config=fixed_config,
1153
+ level=level,
1154
+ question="mean",
1155
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1156
+ )
1157
+
1158
+
1159
+ class DashboardRetrieveIncidentAndMedianGreaterFilterIncidentListTask(
1160
+ DashboardRetrieveIncidentAndFilterIncidentListTask, DashDoFinalTask
1161
+ ):
1162
+ def __init__(
1163
+ self,
1164
+ instance: SNowInstance = None,
1165
+ seed: int = None,
1166
+ fixed_config: list[AbstractServiceNowTask] = None,
1167
+ level: int = 2,
1168
+ ) -> None:
1169
+ """
1170
+ Retrieve the best or worst performing agent and filter an incident list based on their assignments.
1171
+ Attributes:
1172
+ -----------
1173
+ task_description: str
1174
+ The start of the task description to be completed.
1175
+ short_description: str
1176
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter an incident list based on their assignments."
1177
+ """
1178
+ self.filter_than = "greater"
1179
+ super().__init__(
1180
+ instance=instance,
1181
+ seed=seed,
1182
+ fixed_config=fixed_config,
1183
+ level=level,
1184
+ question="median",
1185
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1186
+ )
1187
+
1188
+
1189
+ class DashboardRetrieveIncidentAndModeGreaterFilterIncidentListTask(
1190
+ DashboardRetrieveIncidentAndFilterIncidentListTask, DashDoFinalTask
1191
+ ):
1192
+ def __init__(
1193
+ self,
1194
+ instance: SNowInstance = None,
1195
+ seed: int = None,
1196
+ fixed_config: list[AbstractServiceNowTask] = None,
1197
+ level: int = 2,
1198
+ ) -> None:
1199
+ """
1200
+ Retrieve the best or worst performing agent and filter an incident list based on their assignments.
1201
+ Attributes:
1202
+ -----------
1203
+ task_description: str
1204
+ The start of the task description to be completed.
1205
+ short_description: str
1206
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter an incident list based on their assignments."
1207
+ """
1208
+ self.filter_than = "greater"
1209
+ super().__init__(
1210
+ instance=instance,
1211
+ seed=seed,
1212
+ fixed_config=fixed_config,
1213
+ level=level,
1214
+ question="mode",
1215
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1216
+ )
1217
+
1218
+
1219
+ class DashboardRetrieveIncidentAndMeanLesserFilterIncidentListTask(
1220
+ DashboardRetrieveIncidentAndFilterIncidentListTask, DashDoFinalTask
1221
+ ):
1222
+ def __init__(
1223
+ self,
1224
+ instance: SNowInstance = None,
1225
+ seed: int = None,
1226
+ fixed_config: list[AbstractServiceNowTask] = None,
1227
+ level: int = 2,
1228
+ ) -> None:
1229
+ """
1230
+ Retrieve the best or worst performing agent and filter an incident list based on their assignments.
1231
+ Attributes:
1232
+ -----------
1233
+ task_description: str
1234
+ The start of the task description to be completed.
1235
+ short_description: str
1236
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter an incident list based on their assignments."
1237
+ """
1238
+ self.filter_than = "lesser"
1239
+ super().__init__(
1240
+ instance=instance,
1241
+ seed=seed,
1242
+ fixed_config=fixed_config,
1243
+ level=level,
1244
+ question="mean",
1245
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1246
+ )
1247
+
1248
+
1249
+ class DashboardRetrieveIncidentAndMedianLesserFilterIncidentListTask(
1250
+ DashboardRetrieveIncidentAndFilterIncidentListTask, DashDoFinalTask
1251
+ ):
1252
+ def __init__(
1253
+ self,
1254
+ instance: SNowInstance = None,
1255
+ seed: int = None,
1256
+ fixed_config: list[AbstractServiceNowTask] = None,
1257
+ level: int = 2,
1258
+ ) -> None:
1259
+ """
1260
+ Retrieve the best or worst performing agent and filter an incident list based on their assignments.
1261
+ Attributes:
1262
+ -----------
1263
+ task_description: str
1264
+ The start of the task description to be completed.
1265
+ short_description: str
1266
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter an incident list based on their assignments."
1267
+ """
1268
+ self.filter_than = "lesser"
1269
+ super().__init__(
1270
+ instance=instance,
1271
+ seed=seed,
1272
+ fixed_config=fixed_config,
1273
+ level=level,
1274
+ question="median",
1275
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1276
+ )
1277
+
1278
+
1279
+ class DashboardRetrieveIncidentAndModeLesserFilterIncidentListTask(
1280
+ DashboardRetrieveIncidentAndFilterIncidentListTask, DashDoFinalTask
1281
+ ):
1282
+ def __init__(
1283
+ self,
1284
+ instance: SNowInstance = None,
1285
+ seed: int = None,
1286
+ fixed_config: list[AbstractServiceNowTask] = None,
1287
+ level: int = 2,
1288
+ ) -> None:
1289
+ """
1290
+ Retrieve the best or worst performing agent and filter an incident list based on their assignments.
1291
+ Attributes:
1292
+ -----------
1293
+ task_description: str
1294
+ The start of the task description to be completed.
1295
+ short_description: str
1296
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter an incident list based on their assignments."
1297
+ """
1298
+ self.filter_than = "lesser"
1299
+ super().__init__(
1300
+ instance=instance,
1301
+ seed=seed,
1302
+ fixed_config=fixed_config,
1303
+ level=level,
1304
+ question="mode",
1305
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1306
+ )
1307
+
1308
+
1309
+ class DashboardRetrieveIncidentAndMaxFilterUserListTask(
1310
+ DashboardRetrieveIncidentAndFilterUserListTask, DashDoFinalTask
1311
+ ):
1312
+ def __init__(
1313
+ self,
1314
+ instance: SNowInstance = None,
1315
+ seed: int = None,
1316
+ fixed_config: list[AbstractServiceNowTask] = None,
1317
+ level: int = 2,
1318
+ ) -> None:
1319
+ """
1320
+ Retrieve the best or worst performing agent and filter a user list based on their assignments.
1321
+ Attributes:
1322
+ -----------
1323
+ task_description: str
1324
+ The start of the task description to be completed.
1325
+ short_description: str
1326
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a user list based on their assignments."
1327
+ """
1328
+ self.filter_than = None
1329
+ super().__init__(
1330
+ instance=instance,
1331
+ seed=seed,
1332
+ fixed_config=fixed_config,
1333
+ level=level,
1334
+ question="max",
1335
+ dashboard_class=SingleChartMinMaxRetrievalTask,
1336
+ )
1337
+
1338
+
1339
+ class DashboardRetrieveIncidentAndMinFilterUserListTask(
1340
+ DashboardRetrieveIncidentAndFilterUserListTask, DashDoFinalTask
1341
+ ):
1342
+ def __init__(
1343
+ self,
1344
+ instance: SNowInstance = None,
1345
+ seed: int = None,
1346
+ fixed_config: list[AbstractServiceNowTask] = None,
1347
+ level: int = 2,
1348
+ ) -> None:
1349
+ """
1350
+ Retrieve the best or worst performing agent and filter a user list based on their assignments.
1351
+ Attributes:
1352
+ -----------
1353
+ task_description: str
1354
+ The start of the task description to be completed.
1355
+ short_description: str
1356
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a user list based on their assignments."
1357
+ """
1358
+ self.filter_than = None
1359
+ super().__init__(
1360
+ instance=instance,
1361
+ seed=seed,
1362
+ fixed_config=fixed_config,
1363
+ level=level,
1364
+ question="min",
1365
+ dashboard_class=SingleChartMinMaxRetrievalTask,
1366
+ )
1367
+
1368
+
1369
+ class DashboardRetrieveIncidentAndMeanGreaterFilterUserListTask(
1370
+ DashboardRetrieveIncidentAndFilterUserListTask, DashDoFinalTask
1371
+ ):
1372
+ def __init__(
1373
+ self,
1374
+ instance: SNowInstance = None,
1375
+ seed: int = None,
1376
+ fixed_config: list[AbstractServiceNowTask] = None,
1377
+ level: int = 2,
1378
+ ) -> None:
1379
+ """
1380
+ Retrieve the best or worst performing agent and filter a user list based on their assignments.
1381
+ Attributes:
1382
+ -----------
1383
+ task_description: str
1384
+ The start of the task description to be completed.
1385
+ short_description: str
1386
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a user list based on their assignments."
1387
+ """
1388
+ self.filter_than = "greater"
1389
+ super().__init__(
1390
+ instance=instance,
1391
+ seed=seed,
1392
+ fixed_config=fixed_config,
1393
+ level=level,
1394
+ question="mean",
1395
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1396
+ )
1397
+
1398
+
1399
+ class DashboardRetrieveIncidentAndMedianGreaterFilterUserListTask(
1400
+ DashboardRetrieveIncidentAndFilterUserListTask, DashDoFinalTask
1401
+ ):
1402
+ def __init__(
1403
+ self,
1404
+ instance: SNowInstance = None,
1405
+ seed: int = None,
1406
+ fixed_config: list[AbstractServiceNowTask] = None,
1407
+ level: int = 2,
1408
+ ) -> None:
1409
+ """
1410
+ Retrieve the best or worst performing agent and filter a user list based on their assignments.
1411
+ Attributes:
1412
+ -----------
1413
+ task_description: str
1414
+ The start of the task description to be completed.
1415
+ short_description: str
1416
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a user list based on their assignments."
1417
+ """
1418
+ self.filter_than = "greater"
1419
+ super().__init__(
1420
+ instance=instance,
1421
+ seed=seed,
1422
+ fixed_config=fixed_config,
1423
+ level=level,
1424
+ question="median",
1425
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1426
+ )
1427
+
1428
+
1429
+ class DashboardRetrieveIncidentAndModeGreaterFilterUserListTask(
1430
+ DashboardRetrieveIncidentAndFilterUserListTask, DashDoFinalTask
1431
+ ):
1432
+ def __init__(
1433
+ self,
1434
+ instance: SNowInstance = None,
1435
+ seed: int = None,
1436
+ fixed_config: list[AbstractServiceNowTask] = None,
1437
+ level: int = 2,
1438
+ ) -> None:
1439
+ """
1440
+ Retrieve the best or worst performing agent and filter a user list based on their assignments.
1441
+ Attributes:
1442
+ -----------
1443
+ task_description: str
1444
+ The start of the task description to be completed.
1445
+ short_description: str
1446
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a user list based on their assignments."
1447
+ """
1448
+ self.filter_than = "greater"
1449
+ super().__init__(
1450
+ instance=instance,
1451
+ seed=seed,
1452
+ fixed_config=fixed_config,
1453
+ level=level,
1454
+ question="mode",
1455
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1456
+ )
1457
+
1458
+
1459
+ class DashboardRetrieveIncidentAndMeanLesserFilterUserListTask(
1460
+ DashboardRetrieveIncidentAndFilterUserListTask, DashDoFinalTask
1461
+ ):
1462
+ def __init__(
1463
+ self,
1464
+ instance: SNowInstance = None,
1465
+ seed: int = None,
1466
+ fixed_config: list[AbstractServiceNowTask] = None,
1467
+ level: int = 2,
1468
+ ) -> None:
1469
+ """
1470
+ Retrieve the best or worst performing agent and filter a user list based on their assignments.
1471
+ Attributes:
1472
+ -----------
1473
+ task_description: str
1474
+ The start of the task description to be completed.
1475
+ short_description: str
1476
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a user list based on their assignments."
1477
+ """
1478
+ self.filter_than = "lesser"
1479
+ super().__init__(
1480
+ instance=instance,
1481
+ seed=seed,
1482
+ fixed_config=fixed_config,
1483
+ level=level,
1484
+ question="mean",
1485
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1486
+ )
1487
+
1488
+
1489
+ class DashboardRetrieveIncidentAndMedianLesserFilterUserListTask(
1490
+ DashboardRetrieveIncidentAndFilterUserListTask, DashDoFinalTask
1491
+ ):
1492
+ def __init__(
1493
+ self,
1494
+ instance: SNowInstance = None,
1495
+ seed: int = None,
1496
+ fixed_config: list[AbstractServiceNowTask] = None,
1497
+ level: int = 2,
1498
+ ) -> None:
1499
+ """
1500
+ Retrieve the best or worst performing agent and filter a user list based on their assignments.
1501
+ Attributes:
1502
+ -----------
1503
+ task_description: str
1504
+ The start of the task description to be completed.
1505
+ short_description: str
1506
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a user list based on their assignments."
1507
+ """
1508
+ self.filter_than = "lesser"
1509
+ super().__init__(
1510
+ instance=instance,
1511
+ seed=seed,
1512
+ fixed_config=fixed_config,
1513
+ level=level,
1514
+ question="median",
1515
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1516
+ )
1517
+
1518
+
1519
+ class DashboardRetrieveIncidentAndModeLesserFilterUserListTask(
1520
+ DashboardRetrieveIncidentAndFilterUserListTask, DashDoFinalTask
1521
+ ):
1522
+ def __init__(
1523
+ self,
1524
+ instance: SNowInstance = None,
1525
+ seed: int = None,
1526
+ fixed_config: list[AbstractServiceNowTask] = None,
1527
+ level: int = 2,
1528
+ ) -> None:
1529
+ """
1530
+ Retrieve the best or worst performing agent and filter a user list based on their assignments.
1531
+ Attributes:
1532
+ -----------
1533
+ task_description: str
1534
+ The start of the task description to be completed.
1535
+ short_description: str
1536
+ A short description of the task to be completed. "Retrieve the best or worst performing agent and filter a user list based on their assignments."
1537
+ """
1538
+ self.filter_than = "lesser"
1539
+ super().__init__(
1540
+ instance=instance,
1541
+ seed=seed,
1542
+ fixed_config=fixed_config,
1543
+ level=level,
1544
+ question="mode",
1545
+ dashboard_class=SingleChartMeanMedianModeRetrievalTask,
1546
+ )
1547
+
1548
+
1549
+ local_vars = locals().copy()
1550
+
1551
+ __TASKS__ = [
1552
+ var
1553
+ for var in local_vars.values()
1554
+ if isinstance(var, type) and issubclass(var, DashDoFinalTask) and var is not DashDoFinalTask
1555
+ ]
1556
+
1557
+ DASH_COMPUTE_MAX_FILTER_LIST = [
1558
+ DashboardRetrieveIncidentAndMaxFilterAssetListTask,
1559
+ DashboardRetrieveIncidentAndMaxFilterHardwareListTask,
1560
+ DashboardRetrieveIncidentAndMaxFilterIncidentListTask,
1561
+ DashboardRetrieveIncidentAndMaxFilterUserListTask,
1562
+ ]
1563
+ DASH_COMPUTE_MIN_FILTER_LIST = [
1564
+ DashboardRetrieveIncidentAndMinFilterAssetListTask,
1565
+ DashboardRetrieveIncidentAndMinFilterHardwareListTask,
1566
+ DashboardRetrieveIncidentAndMinFilterIncidentListTask,
1567
+ DashboardRetrieveIncidentAndMinFilterUserListTask,
1568
+ ]
1569
+ DASH_COMPUTE_MEAN_FILTER_LIST = [
1570
+ DashboardRetrieveIncidentAndMeanGreaterFilterAssetListTask,
1571
+ DashboardRetrieveIncidentAndMeanGreaterFilterHardwareListTask,
1572
+ DashboardRetrieveIncidentAndMeanGreaterFilterIncidentListTask,
1573
+ DashboardRetrieveIncidentAndMeanGreaterFilterUserListTask,
1574
+ DashboardRetrieveIncidentAndMeanLesserFilterAssetListTask,
1575
+ DashboardRetrieveIncidentAndMeanLesserFilterHardwareListTask,
1576
+ DashboardRetrieveIncidentAndMeanLesserFilterIncidentListTask,
1577
+ DashboardRetrieveIncidentAndMeanLesserFilterUserListTask,
1578
+ ]
1579
+
1580
+ DASH_COMPUTE_MEDIAN_FILTER_LIST = [
1581
+ DashboardRetrieveIncidentAndMedianGreaterFilterAssetListTask,
1582
+ DashboardRetrieveIncidentAndMedianLesserFilterAssetListTask,
1583
+ DashboardRetrieveIncidentAndMedianGreaterFilterHardwareListTask,
1584
+ DashboardRetrieveIncidentAndMedianLesserFilterHardwareListTask,
1585
+ DashboardRetrieveIncidentAndMedianGreaterFilterIncidentListTask,
1586
+ DashboardRetrieveIncidentAndMedianLesserFilterIncidentListTask,
1587
+ DashboardRetrieveIncidentAndMedianGreaterFilterUserListTask,
1588
+ DashboardRetrieveIncidentAndMedianLesserFilterUserListTask,
1589
+ ]
1590
+
1591
+ DASH_COMPUTE_MODE_FILTER_LIST = [
1592
+ DashboardRetrieveIncidentAndModeGreaterFilterAssetListTask,
1593
+ DashboardRetrieveIncidentAndModeLesserFilterAssetListTask,
1594
+ DashboardRetrieveIncidentAndModeGreaterFilterHardwareListTask,
1595
+ DashboardRetrieveIncidentAndModeLesserFilterHardwareListTask,
1596
+ DashboardRetrieveIncidentAndModeGreaterFilterIncidentListTask,
1597
+ DashboardRetrieveIncidentAndModeLesserFilterIncidentListTask,
1598
+ DashboardRetrieveIncidentAndModeGreaterFilterUserListTask,
1599
+ DashboardRetrieveIncidentAndModeLesserFilterUserListTask,
1600
+ ]