Unable to add members to watchlist of RITM from flow designer

Abhishek18
Tera Contributor

I'm trying to add members from flow designer using Update record action. I have used "Data pills" and "Inline script" to add members from flow designer. But the system is not adding members to watchlist of RITM.

19 REPLIES 19

Abhishek18
Tera Contributor

Hi @Ankur Bawiskar 

 

I'm trying to add Requested for manager to the watchlist from flow designer.

I'm able to do it through business rule but I'm unable to add members to watchlist of RITM from flow designer using "Update Record" Action.

 

I have also written an action and called the action through flow, but it didn't work as well. Please see the below code that I have wirtten in action.

 

When I manually run the action by using Run Test option, it is adding members (Requested for) manager to the watchlist. But when the flow is triggered by system when RITM is created, then it is not adding members to watchlist.

 

var user = fd_data._1__get_catalog_variables.requested_for.manager.sys_id;
return user.toString();
 
used above inline script  under watchlist but it didn't work.
 
Also used action to update the watchlist member but even this didn't work,
var reqid = inputs.RequestItem; //RITM reference
var manager = inputs.Managersysid.toString(); //manager sys id
var glideRequest = new GlideRecord("sc_req_item");
if(glideRequest.get(reqid)){
glideRequest.watch_list=manager;
glideRequest.update();
}
 
 
 

@Abhishek18 

using inline script it should work

you are just returning the single user here

var user = fd_data._1__get_catalog_variables.requested_for.manager.sys_id;
return user.toString();

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Abhishek18
Tera Contributor

Hi @Ankur Bawiskar 

 

Even with the inline script,  the system is not adding.

 

Please see the attached screenshot.

 

@Abhishek18 

are you sure variable name is correct and that user has manager?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Yes, I'm sure on the variable name, I have tried returning just the sys id of the user but it didn't work as well.