How to Trigger change workflow/record producer from transform script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2014 11:45 AM
We have a requirement to create a change request with workflow and approval from a transform map script.
to create the change record, we have a record producer in place. But i'm not sure how to trigger the record producer from transform script and how to ploulate theRP variables.
I tried using Catalog API as mention below but it is creating a RITM instead of change request.
var cart = new Cart(); var item = cart.addItem('sys id of record producer'); cart.setVariable(item, 'RP variable name', source.TransformMapVariableName); ..... var rc = cart.placeOrder(); gs.log(rc.number);
above code is not working, is there any other mathod to invoke change_request with workflow from a transform script ?
Pradeep Sharma can you help ?
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2022 08:21 PM
Question - there is an OOTB record producer API that seems works pretty well. Is there any way to either call that internally or see what it's calling to make the magic happen?
/api/sn_sc/servicecatalog/items/{sys_id}/submit_producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 05:24 AM
in case someone stumbles on this thread in the future
there is a actually an out-of-the-box function that does exactly that (and it also executes the script from the record producer), all that natively:
https://developer.servicenow.com/dev.do#!/reference/api/utah/server/sn_sc-namespace/c_CatItem#CI-sub...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 02:56 PM
It's been a while since I looked into this, but I have a suspicion there was an issue with this approach. Could be that the variables aren't created for record that is produced like they are with catalog items. I think it would only populate fields that were present on the record being created. In my case I wanted variables, like you have on RITMs, but for a custom task type.