How can I create relationship to show approvers on task level

SN2024
Tera Contributor

 

I am trying to show approvers for the REQ and RITM on Task level so the resolvers don't have to go to the REQ or RITM to view the approvers.

I tried to create Relationship in system definition but it didn't work. still showing no approvers on Task "Approvers" tab

Relationship :

Applies to Table: Catalog Task [sc_task]

Queries from table: Approval[sysapproval_approver]

 

with Query:

var enc = "document_id=" + parent.request_item;
current.addEncodedQuery(enc);

 

Looking for some help and guidance on this.

 

Thank you.

2 ACCEPTED SOLUTIONS

Hi @SN2024 ,

create a relationship

ChaitanyaILCR_0-1745984431505.png

configure related list on sc task and add the relationship to it

ChaitanyaILCR_1-1745984547829.png

ChaitanyaILCR_3-1745984584773.pngChaitanyaILCR_4-1745984640304.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

View solution in original post

@SN2024 

you added wrong Related list in your form.

The script is correct

Please configure Related list and add this related list on form -> search with name Request Approvers

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

5 REPLIES 5

shun6
Giga Sage

@SN2024 

Since "document_id"  is sys_id of the record stored at Approval[sysapproval_approver] itself, use the "Approval For" field for queries instead.

current.addQuery("sysapproval", parent.request_item)

 

Thannks.

Ankur Bawiskar
Tera Patron
Tera Patron

@SN2024 

try this -> the document_id field is wrong field, the correct field is sysapproval

var enc = "sysapproval=" + parent.request_item;
current.addEncodedQuery(enc);

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

SN2024
Tera Contributor

Thank you for your response.

I have tried this in the developer instance but no luck. It doesn't show approvers list on task level.

Screenshot 2025-04-30.png

SN2024_0-1745982755253.png

 

Hi @SN2024 ,

create a relationship

ChaitanyaILCR_0-1745984431505.png

configure related list on sc task and add the relationship to it

ChaitanyaILCR_1-1745984547829.png

ChaitanyaILCR_3-1745984584773.pngChaitanyaILCR_4-1745984640304.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya