Creating a related list where the Task parent is the same as the Request Item parent

Josh Evans
Tera Contributor

Hello All,

 

I would like to create a new related list on the Requested Item table where it contains a list of tasks whose parent is the same as the Request Item parent. For example, we have a Request Item whose parent is REQ000001, I would like to see the related list of tasks whose parent is also REQ000001 on the request item table. We have some flows where a catalog task appears on the REQ and not the RITM and it is confusing some users. 

 

 

Let me know if you have any additional questions or clarifications.

 

Screenshot of current Related List:

JoshEvans_1-1737578074353.png

 

Thanks for your help!

1 REPLY 1

Nick Parsons
Mega Sage

You can try with looking at the parent field on the sc_task which matches the parent from the RITM (parent.parent)

 

 

// here current = sc_task, parent = sc_req_item, parent.parent = sc_request (parent of your RITM)
current.addQuery("parent", parent.parent.sys_id);

 

Your code doesn't work as you're trying to query the sc_task field from the sc_req_item table (which doesn't exist). you're also trying to compare a reference field (parent) with an REQ number which wouldn't work either.