How to get import set run status in RITM Worknotes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 11:20 PM
How to get import set run status in RITM Worknotes?
I have created data source, transform maps, scheduled import and flow designers. the only requirement is to update the import set run log to ritm work notes.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 11:50 PM
Hello,
Could you please refer below thread if it helps -
Regards,
Akshay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2022 11:21 PM
Hi Akshay,
Thanks for the solution. can you please elaborate the process?
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2022 12:44 AM
Hi Kavithan, Did you get a chance to find a solution for this requirement? I am trying to achieve the same, any inputs will be highly appreciated. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2022 05:27 AM
Hello Pari,
If you want to update the Import set number on RITM when the RITM are being created using the Import set then you can use something like below code in your onBefore Transform script:
You need to set ignore = true when action == "insert" otherwise the RITM will be created in sc_req_item table incorrect if your target table is sc_req_item on Transform map.
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if (action == "insert")
ignore = true;
var cartid = "cart_" + gs.generateGUID(); // along with gs.generateGUID() we should append "cart_". This can be used as unique id for the Cart.
var cart = new sn_sc.CartJS(cartid);
var request = {
"sysparm_id": "04b7e94b4f7b4200086eeed18110c7fd",
"sysparm_quantity": "1",
"variables": {
"acrobat": source.u_acrobat + "",
"photoshop": source.u_photoshop + "",
"Additional_software_requirements": source.u_additional_s_e_requirements
},
"sysparm_cart_name": cartid // Use "sysparm_cart_name" to set the Cart ID for this cart. This was something that was not clear to me.
};
var cartRequest = cart.orderNow(request);
var requestId = "";
if (cartRequest.request_number) {
var scReqItem = new GlideRecord("sc_req_item");
if (scReqItem.get("request", cartRequest.request_id)) {
scReqItem.work_notes = "RITM created by Import set process " + import_set.number;
scReqItem.update();
}
}
})(source, map, log, target);
Please mark this helpful/correct, if it answer your question.
Thanks