Starting a workflow through REST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 08:20 AM
Hello -
I am creating a RITM record through REST. I am setting the Item to the appropriate catalog item, which should trigger a workflow, but the workflow never is kicked-off. Is it possible to kick-off a workflow for a RITM through a REST message?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 11:43 AM
Hi
Its the business rule "Start Workflow" in the sc_req_item table which actually starts the workflow. This happens after the requested item is updated and stage=='request_approved'
So if you don't use tthe standard way of creating a requested item via a script, then you need to update the requested item record after insert and set the stage field
Official way: http://wiki.servicenow.com/index.php?title=Order_a_Service_Catalog_Item_from_a_Script#gsc.tab=0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 11:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 11:54 AM
Yes if you use the Service Catalog API there is an order_now method. If you use this the workflow should be activated
POST https://{instance].service-now.com/api/sn_sc/servicecatalog/items/{sys_id}/order_now
https://developer.servicenow.com/app.do#!/rest_api_doc?v=helsinki&id=c_ServiceCatalogAPI
The documentation does not describe the order_now method, but it should work the same way as the checkout_guide method