Custom Related List Relation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 10:05 PM
Hello,
We do have a requirement to include related incident of SCTASK in the related list of SCTASK form level. However, there is no direct related list selection available for this & doesn't seem to be a field in incident storing SCTASK value either, that makes building relationship logic unfeasible.
Any suggestions for a workaround?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 04:38 AM
Hi @Arjit Gourav ,
You could achieve this using Relationships in Servicenow
- Navigate to System Definition->Relationships
-Create a new relationship as below:
-Note that request mentioned here is a field in incident form. Make sure request number is captured anywhere in your incident form or if it is not captured in any oob field , create a new field and capture it.
(Do a fix script for old incident)
-Add your created Related list to Task table by navigating to Configure->Related list and search for your related list and add it.
Please mark my answer helpful if it solved your query.Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 05:58 AM
Thanks for checking.
Just a small small correction. Instead of "parent.request.sys_id" , it has to be "parent.request.parent.sys_id" .
Works now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 05:30 AM
Hi @Arjit Gourav ,
Yep!It worked in my PDI.We have to tweak the query according to our instance .Glad it worked.
Please mark my answer helpful/Correct answer if it solved your query.Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 06:53 AM
Hi @Arjit Gourav ,
I have done something similar to this but in order to achieve this there should be a field in incident which will be capturing the sc task number that got created otherwise relationship can not be created,
Steps to create
1. Go to module relationships under system definition
2. In Applies to table give sc task
3. Queries from table as incident
and in script use the below,
current.addQuery('sctask_ref.number', parent.number);
here sctask_ref is a referencing to sc task table
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 12:04 PM
Thanks.. Achieved with with the sys_id matching.