Skip to content

Commit 0e62399

Browse files
authored
Merge pull request #126 from ServiceNow/scratch/add-create-incident-tasks
add incident tasks with custom goal
2 parents 98bc9ff + ead24f9 commit 0e62399

File tree

2 files changed

+269
-9
lines changed

2 files changed

+269
-9
lines changed

src/browsergym/workarena/data_files/task_configs/create_workspace_incident_task.json

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,260 @@
115115
"short_description": "Reset my password",
116116
"business_impact": "trivial reset password"
117117
}
118+
},
119+
{
120+
"goal": "In the Service Operations workspace, create a {urgency} urgency child incident under {parent_incident}. The incident should be opened for {caller_id} under the {category} category and the short description should say that {short_description}",
121+
"fields": {
122+
"assignment_group": "Assignment group",
123+
"business_impact": "Business impact",
124+
"business_service": "Service",
125+
"caller_id": "Caller",
126+
"category": "Category",
127+
"caused_by": "Caused by Change",
128+
"close_code": "Resolution code",
129+
"close_notes": "Resolution notes",
130+
"cmdb_ci": "Configuration item",
131+
"contact_type": "Channel",
132+
"description": "Description",
133+
"impact": "Impact",
134+
"knowledge": "Knowledge",
135+
"number": "Number",
136+
"parent_incident": "Parent Incident",
137+
"problem_id": "Problem",
138+
"resolved_by": "Resolved by",
139+
"rfc": "Change Request",
140+
"service_offering": "Service offering",
141+
"short_description": "Short description",
142+
"urgency": "Urgency",
143+
"work_notes": "Work notes"
144+
},
145+
"task_fields": [
146+
"caller_id",
147+
"urgency",
148+
"category",
149+
"short_description",
150+
"parent_incident"
151+
],
152+
"template_record": {
153+
"caller_id": "Owen Sparacino",
154+
"urgency": "3 - Low",
155+
"category": "Inquiry / Help",
156+
"short_description": "he can't locate the Weather Bug icon on his desktop",
157+
"parent_incident": "INC0000029"
158+
}
159+
},
160+
{
161+
"goal": "In the Service Operations workspace, create a {urgency} urgency child incident under {parent_incident}. The incident should be opened for {caller_id} under the {category} category and the short description should say that {short_description}",
162+
"fields": {
163+
"assignment_group": "Assignment group",
164+
"business_impact": "Business impact",
165+
"business_service": "Service",
166+
"caller_id": "Caller",
167+
"category": "Category",
168+
"caused_by": "Caused by Change",
169+
"close_code": "Resolution code",
170+
"close_notes": "Resolution notes",
171+
"cmdb_ci": "Configuration item",
172+
"contact_type": "Channel",
173+
"description": "Description",
174+
"impact": "Impact",
175+
"knowledge": "Knowledge",
176+
"number": "Number",
177+
"parent_incident": "Parent Incident",
178+
"problem_id": "Problem",
179+
"resolved_by": "Resolved by",
180+
"rfc": "Change Request",
181+
"service_offering": "Service offering",
182+
"short_description": "Short description",
183+
"urgency": "Urgency",
184+
"work_notes": "Work notes"
185+
},
186+
"task_fields": [
187+
"caller_id",
188+
"urgency",
189+
"category",
190+
"short_description",
191+
"parent_incident"
192+
],
193+
"template_record": {
194+
"caller_id": "Genevieve Kekiwi",
195+
"urgency": "2 - Medium",
196+
"category": "Inquiry / Help",
197+
"short_description": "she is unable to send and receive emails",
198+
"parent_incident": "INC0000049"
199+
}
200+
},
201+
{
202+
"goal": "In the Service Operations workspace, create a {urgency} urgency child incident under {parent_incident}. The incident should be opened for {caller_id} under the {category} category and the short description should say that {short_description}",
203+
"fields": {
204+
"assignment_group": "Assignment group",
205+
"business_impact": "Business impact",
206+
"business_service": "Service",
207+
"caller_id": "Caller",
208+
"category": "Category",
209+
"caused_by": "Caused by Change",
210+
"close_code": "Resolution code",
211+
"close_notes": "Resolution notes",
212+
"cmdb_ci": "Configuration item",
213+
"contact_type": "Channel",
214+
"description": "Description",
215+
"impact": "Impact",
216+
"knowledge": "Knowledge",
217+
"number": "Number",
218+
"parent_incident": "Parent Incident",
219+
"problem_id": "Problem",
220+
"resolved_by": "Resolved by",
221+
"rfc": "Change Request",
222+
"service_offering": "Service offering",
223+
"short_description": "Short description",
224+
"urgency": "Urgency",
225+
"work_notes": "Work notes"
226+
},
227+
"task_fields": [
228+
"caller_id",
229+
"urgency",
230+
"category",
231+
"short_description",
232+
"parent_incident"
233+
],
234+
"template_record": {
235+
"caller_id": "Margot Arenburg",
236+
"urgency": "1 - High",
237+
"category": "Inquiry / Help",
238+
"short_description": "she can't connect to Exchange",
239+
"parent_incident": "INC0000037"
240+
}
241+
},
242+
{
243+
"goal": "In the Service Operations workspace, create an incident for a {category} issue called in by {caller_id}: {short_description}. Set impact and urgency as {impact} and add {watch_list} to the watchlist",
244+
"fields": {
245+
"assignment_group": "Assignment group",
246+
"business_impact": "Business impact",
247+
"business_service": "Service",
248+
"caller_id": "Caller",
249+
"category": "Category",
250+
"caused_by": "Caused by Change",
251+
"close_code": "Resolution code",
252+
"close_notes": "Resolution notes",
253+
"cmdb_ci": "Configuration item",
254+
"contact_type": "Channel",
255+
"description": "Description",
256+
"impact": "Impact",
257+
"knowledge": "Knowledge",
258+
"number": "Number",
259+
"parent_incident": "Parent Incident",
260+
"problem_id": "Problem",
261+
"resolved_by": "Resolved by",
262+
"rfc": "Change Request",
263+
"service_offering": "Service offering",
264+
"short_description": "Short description",
265+
"urgency": "Urgency",
266+
"watch_list": "Watch list",
267+
"work_notes": "Work notes"
268+
},
269+
"task_fields": [
270+
"caller_id",
271+
"category",
272+
"impact",
273+
"urgency",
274+
"short_description",
275+
"watch_list"
276+
],
277+
"template_record": {
278+
"caller_id": "Evan Pyfrom",
279+
"category": "Hardware",
280+
"impact": "3 - Low",
281+
"urgency": "3 - Low",
282+
"short_description": "His mouse is stuttering",
283+
"watch_list": "Sharlene Circelli"
284+
}
285+
},
286+
{
287+
"goal": "In the Service Operations workspace, create an incident for a {category} issue called in by {caller_id}: {short_description}. Set impact and urgency as {impact} and add {watch_list} to the watchlist",
288+
"fields": {
289+
"assignment_group": "Assignment group",
290+
"business_impact": "Business impact",
291+
"business_service": "Service",
292+
"caller_id": "Caller",
293+
"category": "Category",
294+
"caused_by": "Caused by Change",
295+
"close_code": "Resolution code",
296+
"close_notes": "Resolution notes",
297+
"cmdb_ci": "Configuration item",
298+
"contact_type": "Channel",
299+
"description": "Description",
300+
"impact": "Impact",
301+
"knowledge": "Knowledge",
302+
"number": "Number",
303+
"parent_incident": "Parent Incident",
304+
"problem_id": "Problem",
305+
"resolved_by": "Resolved by",
306+
"rfc": "Change Request",
307+
"service_offering": "Service offering",
308+
"short_description": "Short description",
309+
"urgency": "Urgency",
310+
"watch_list": "Watch list",
311+
"work_notes": "Work notes"
312+
},
313+
"task_fields": [
314+
"caller_id",
315+
"category",
316+
"impact",
317+
"urgency",
318+
"short_description",
319+
"watch_list"
320+
],
321+
"template_record": {
322+
"caller_id": "Kennith Peto",
323+
"category": "Network",
324+
"impact": "2 - Medium",
325+
"urgency": "2 - Medium",
326+
"short_description": "The system is not accepting his new password",
327+
"watch_list": "Nathanial Phoenix"
328+
}
329+
},
330+
{
331+
"goal": "In the Service Operations workspace, create an incident for a {category} issue called in by {caller_id}: {short_description}. Set impact and urgency as {impact} and add {watch_list} to the watchlist",
332+
"fields": {
333+
"assignment_group": "Assignment group",
334+
"business_impact": "Business impact",
335+
"business_service": "Service",
336+
"caller_id": "Caller",
337+
"category": "Category",
338+
"caused_by": "Caused by Change",
339+
"close_code": "Resolution code",
340+
"close_notes": "Resolution notes",
341+
"cmdb_ci": "Configuration item",
342+
"contact_type": "Channel",
343+
"description": "Description",
344+
"impact": "Impact",
345+
"knowledge": "Knowledge",
346+
"number": "Number",
347+
"parent_incident": "Parent Incident",
348+
"problem_id": "Problem",
349+
"resolved_by": "Resolved by",
350+
"rfc": "Change Request",
351+
"service_offering": "Service offering",
352+
"short_description": "Short description",
353+
"urgency": "Urgency",
354+
"watch_list": "Watch list",
355+
"work_notes": "Work notes"
356+
},
357+
"task_fields": [
358+
"caller_id",
359+
"category",
360+
"impact",
361+
"urgency",
362+
"short_description",
363+
"watch_list"
364+
],
365+
"template_record": {
366+
"caller_id": "Mara Rineheart",
367+
"category": "Software",
368+
"impact": "1 - High",
369+
"urgency": "1 - High",
370+
"short_description": "All employee laptops in the New York office have been infected with malware",
371+
"watch_list": "Dude Lewbowskie"
372+
}
118373
}
119374
]

src/browsergym/workarena/tasks/form_workspace.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,23 @@ def setup_goal(self, page: Page) -> tuple[str, dict]:
2222
if self.fixed_config is None:
2323
self._set_required_config_attributes(config)
2424
self.protected_fields = self.task_fields
25-
# Generate the goal
26-
goal = (
27-
f"In the Service Operations workspace, create a new {self.table_label} with "
28-
+ prettyprint_enum(
29-
[
30-
f'a value of "{self.template_record[f]}"'
25+
26+
if "goal" in self.config:
27+
goal = self.config["goal"]
28+
# replace placeholders
29+
goal = goal.format(**self.template_record)
30+
else:
31+
goal = (
32+
f"In the Service Operations workspace, create a new {self.table_label} with "
33+
+ prettyprint_enum(
34+
[
35+
f'a value of "{self.template_record[f]}"'
3136
+ f' for field "{self.config["fields"][f]}"'
3237
for f in self.task_fields
3338
]
3439
)
35-
+ "."
36-
)
40+
+ "."
41+
)
3742
info = {}
3843

3944
return goal, info
@@ -108,7 +113,7 @@ def validate(
108113
logging.info(error_msg)
109114
return (
110115
0,
111-
True,
116+
False, # False because we should let the agent continue trying
112117
error_msg,
113118
{"message": error_msg},
114119
)

0 commit comments

Comments
 (0)