- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 09:31 AM
Hi There,
i have catalog item where approvals and notifications are triggered from flow designers.
trigger condition for item is service catalog.
everything in flow is working as expected but RITM stage is acting diff. it is showing request approved all the time even if the approvals are are not approved.
and also there is one more query.
requested for on RITM should be set to the person from the catalog variable user who needs access
so created an action in flow designer to set requested for
these are inputs:
this is the script to populate requested for
var req_type =inputs.request_type;
var sys_id=inputs.ritmno;
var UserAssignedTo = inputs.UserWhoNeedsAccess;
if (req_type == 'Grant Access to Swiss Re Website') {
gs.info('RequestItem Sys id' + sys_id);
var gr = new GlideRecord("sc_req_item");
gr.addQuery('sys_id', sys_id);
gr.query();
while (gr.next()) {
var req = gr.request;
var grR = new GlideRecord('sc_request');
grR.addQuery('sys_id', req);
grR.query();
while (grR.next()) {
grR.requested_for = inputs.UserWhoNeedsAccessSysId;
grR.update();
}
}
so this script is getting user from catalog variable and populating it in requested for
but when i check in show XML it still populates the user who is requesting the catalog item
Please do help if anyone knows how to fix
Thankyou
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 09:39 AM
Hi,
So there is a field on sc_req_item called requested_for, which is the one you are referencing in the XML. So you should also set that, when you are changing the requested_for on sc_request.
Regarding your stages, you need to set those in your flow. There is something called "Flow stages", where you need to add them. You can find them by clicking the three dots on the top right when you have the flow open. Then select them from the template and apply the ones you need to use.
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 09:39 AM
Hi,
So there is a field on sc_req_item called requested_for, which is the one you are referencing in the XML. So you should also set that, when you are changing the requested_for on sc_request.
Regarding your stages, you need to set those in your flow. There is something called "Flow stages", where you need to add them. You can find them by clicking the three dots on the top right when you have the flow open. Then select them from the template and apply the ones you need to use.
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 10:21 AM
Hi @Sebastian L ,
Thanks for replying
i went in to flow stages and selected the below one waiting for approval
i don't know even then i see the same issue request approved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 10:49 AM
Yes, you also need to set it in the flow. There is fine yellow line where you can define the flow stages. Then you just need to set it in the order you wish:
Best regards,
Sebastian Laursen