# Issue Parts to a Work Order

When parts are issued against a **maintenance work order**, the stock movement and the job are linked: you can see what each repair consumed, what it cost, and which work orders drove a part's usage.

This lesson uses the `Machine 1 - Coolant leak` work order from [Raise a One-Time Work Order](../../6-training-maintenance/02-work-orders/1-one-time-work-order.md). If you haven't taken the Maintenance course, read along.

:::download[Issue script]
<a href="/files/inventory-resources/issuePartToWorkOrder.py" download><code>issuePartToWorkOrder.py</code></a>: issues a part from the Parts Room to a work order by name, then lists every part issued to it.
:::

:::action[Issue hose to the coolant leak work order]

1. In **Maintenance → Work Orders**, note the coolant leak's work order number, such as `MWO00001`.
2. Open `issuePartToWorkOrder.py` in the Ignition Designer Script Console.
3. Set `workOrderEventName` to your work order number, `partNumber` to `CF-HOSE-075`, and `quantity` to `6`.
4. Run the script. It looks up the IDs it needs, calls `issuePartToWorkOrderEvent`, and prints the parts used on the work order.
5. In **Inventory → Parts**, expand `CF-HOSE-075`. On hand is now 19, and the issue references the work order.

:::

The script passes two assets: the **inventory asset** the hose came from (Parts Room) and the **asset** it was used on (Machine 1). That's what lets you report parts consumption by machine as well as by storeroom.

::embed-section{src="../../../kanoa-inventory/inventory-guide.md#issue-against-a-maintenance-work-order" collapsed="true" summary="Reference Materials: Issue Against a Maintenance Work Order"}
