Skip to content

Commit 4fbd044

Browse files
fix teardown for close_case
1 parent 62420f2 commit 4fbd044

File tree

1 file changed

+7
-11
lines changed
  • src/browsergym/workarena/tasks

1 file changed

+7
-11
lines changed

src/browsergym/workarena/tasks/case.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,13 @@ def validate(self, page: playwright.sync_api.Page, chat_messages: List[str]) ->
118118
def teardown(self) -> None:
119119

120120
# revert the state to initial_state
121-
table_api_call(
122-
instance=self.instance,
123-
table="sn_customerservice_case",
124-
method="POST",
125-
data={
126-
"state": self.initial_state,
127-
},
128-
params={
129-
"sysparm_query": f"number={self.config['case_number']}",
130-
"sysparm_fields": "state",
131-
"sysparm_limit": 1,
121+
requests.patch(
122+
f"{self.instance.snow_url}/api/now/table/sn_customerservice_case/{self.record_sys_id}",
123+
auth=self.instance.snow_credentials,
124+
headers={"Accept": "application/json"},
125+
json={
126+
"resolution_code": self.initial_state,
127+
"close_notes": "",
132128
},
133129
)
134130

0 commit comments

Comments
 (0)