Consume a consumable using a workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 04:59 AM
Hi All,
I have created a workflow which I am trying to use to automatically consume consumables when the request is approved/completed.
currently the workflow will add the item as consumed but it won't 'consume' quantity from the existing record. The picture below highlights this: The arrow shows the quantity which isnt decreasing and the circle is the number that increases when the workflow runs. I am trying to set it so that when in stock goes down, consumed goes up.
within the workflow this is the code I am using:
Consumables is the current script include and hasn't been modified.
I have tried to use the following community posts to solve the issue but haven't been able to get the in stock quantity to decrease automatically:
https://www.servicenow.com/community/it-service-management-forum/script-works-in-scripts-background-...
Finally, this is the catalog item I am using to create the request. I have kept the variables visible so it is clear that sysID is being used and not display name
Any help would be greatly appreciated,
Thanks
Alex