Associate a RITM to an existing Request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2023 03:03 AM
I need to associate submitted RITM with an existing request when I am placing an order.
Example - I have an existing Request REQ01 with an item RITM01 and I am trying to submit a catalog item "ITEM" ,
When I successfully submit this "ITEM", the RITM02 which gets genereated as a result of "ITEM" submission should be associated with REQ01.
PS: I have looked into CART Api without luck, however I found that there is an additional parameter which we can pass through the function call in the widget code "spScUtil.orderNow($scope.data.sc_cat_item.sys_id, $scope.data.sc_cat_item.quantity, getVarData($scope.data.sc_cat_item._fields), $scope.data._generatedItemGUID, additionalParms, getAlsoRequestForValue($scope.data.sc_cat_item._fields))"
which is additionalParms , I tried this too with same luck.
Also noticed, the orderNow is a REST API call , which essentially is :
api/sn_sc/servicecatalog/items/{sys_id}/order_now
is not honoring the additional parameter to set the newly generated RITM with an older REQ.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2023 02:38 PM - edited ‎07-15-2023 03:21 PM
You would need to modify the Scripted REST API to make it honor any new parameter.
OOB it uses sn_sc.CartJS to generate new requests.
That API does not support specifying the Requested Item.
That means you would need to re-write/modify not only the Scripted REST API, but you would need to write a replacement for sn_sc.CartJS too.
Perhaps it would be easier to re-parent the generated Requested Item using a Business Rule or a re-usable Sub-Flow (or Activity, if you are using Workflows).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2023 05:09 PM
I was positive about the fact that the Rest API OOB for orderNow and spScUtil.orderNow does accept additional parameter which can associate parent to it, however it is not working as expected .