need help in setting RITM Stage (request approved) - waiting for approval when triggered from flow.

priyanka chodip
Tera Contributor

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.

priyankachodip_1-1682007309640.png

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

 

priyankachodip_3-1682007643529.png

so created an action in flow designer to set requested for 
these are inputs:

priyankachodip_4-1682007812026.png

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

priyankachodip_6-1682008282888.png

but when i check in show XML it still populates the user who is requesting the catalog item 

priyankachodip_5-1682008064585.png


Please do help if anyone knows how to fix
Thankyou

1 ACCEPTED SOLUTION

Sebastian L
Mega Sage

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. 

 

SebastianL_0-1682008763405.png

 


Best regards,
Sebastian Laursen

View solution in original post

3 REPLIES 3

Sebastian L
Mega Sage

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. 

 

SebastianL_0-1682008763405.png

 


Best regards,
Sebastian Laursen

Hi @Sebastian L ,
Thanks for replying
i went in to flow stages and selected the below one waiting for approval

priyankachodip_0-1682011206331.png

i don't know even then i see the same issue request approved.

priyankachodip_1-1682011228450.png

 

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: 

SebastianL_0-1682012928328.png

 


Best regards,
Sebastian Laursen