MCPcopy
hub / github.com/IBM/AssetOpsBench / get_workorder_tasks

Function get_workorder_tasks

src/servers/wo/main.py:144–160  ·  view source on GitHub ↗

List the child tasks of a parent work order.

(
    wonum: str, site_id: str
)

Source from the content-addressed store, hash-verified

142
143
144async def get_workorder_tasks(
145 wonum: str, site_id: str
146) -> Union[TasksResult, ErrorResult]:
147 """List the child tasks of a parent work order."""
148 res = await wo.get_workorder_tasks(db(), wonum, site_id)
149 err = _failed(res)
150 if err:
151 return err
152 d = res["data"]
153 tasks = [WorkOrderItem.model_validate(t) for t in d["tasks"]]
154 return TasksResult(
155 parent_wonum=d["parent_wonum"],
156 site_id=d["site_id"],
157 total=len(tasks),
158 tasks=tasks,
159 message=f"{len(tasks)} task(s) under {wonum}.",
160 )
161
162
163async def get_workorder_costs(

Callers

nothing calls this directly

Calls 3

dbFunction · 0.85
_failedFunction · 0.85
TasksResultClass · 0.85

Tested by

no test coverage detected