- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 06:32 AM
Hi all,
I have a few subflows and I need to add a code in flow designer, within the "assigned to" field code snippet when creating a "catalog task action" (image below)
I need to auto-assign the same person that user would assign this particular task to, to subsequent tasks that creates after in other subflows(so perhaps by using short description name of other tasks).
So I guess I will need to add a code into subsequent tasks "assigned to fields" where I will need to copy same person assigned for previous task.
Anyone can help in writing this code?
Many thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 10:25 AM - edited 03-01-2023 10:29 AM
Hi,
Yea, so have you went to your list view of RITMs and found the RITM you're testing with and double checked that it actually has an SCTASK associated to it with the short description as you're showing?
Just to add more to all this, I have now gone to the level of effort to build a flow and subflow in my own instance to this does work...
var gr = new GlideRecord("sc_task");
gr.addQuery("request_item", fd_data.subflow_inputs.ritm.sys_id);
gr.addQuery("short_description", "Provide requested service");
gr.query();
if (gr.next()) {
return gr.getValue("assigned_to");
}
So in my example script, my input was the RITM trigger record in the parent flow. Keep in mind that you need to test the subflow separately from testing the main flow. Otherwise, do a full execution of the flow in a real test (not a flow designer test) OR...ensure your subflow is Published, not just saved, and then run test from parent flow.
I'm starting to run out of options to assist further without asking that you start all over again with providing precisely what you have today with full screenshots and everything...which I hope we don't need to do. I know what I've provided is working.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 10:43 AM
Hi @cicgordy
Ok, haha, great. My apologies for the back and forth, sometimes it's hard to do all this through just the forums, but I'm glad we got it all settled. Let me know what from my last reply helped get you across the line so that I know where we were stuck. I covered a few things and so I'm unsure what got you there.
In any case, if any other reply was Helpful, please mark it as such and take care! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 10:50 AM
Well, I think it was querying the subflow input that made it work by adding (fd_data.subflow_inputs.ritm.sys_id)
Thank you!!!!!