- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2024 12:38 PM
When state is new , it shows the Add button in related list
But when state is closed , it does not show the Add button on related list
Is there any way to show Add button in related list when state is closed
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 01:49 AM
Hi @Asha Pathak I am using OR condition here so as long as the parent table is problem, the 1st condition (parent.sys_class_name == 'problem') will execute and will ignore the other condition (parent.active == true), for other tables the parent.active will be true. this way there is no impact for other tables and condition works as expected.
Does it work? If yes please accept the solution:)
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 06:31 PM - edited 04-02-2024 06:53 PM
HI @Asha Pathak after checking itseems OOB servicenow you cannot add a CI to the closed records, we would need to do a changes to the OOB script include AssociateCIToTask.
Modified script:
After modifying the above function CI gets added to the closed records
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2024 07:09 PM - edited 03-31-2024 07:09 PM
Hi @Asha Pathak the OOB UI action "ADD" has a condition where it checks parent.active == true in below screenshot which hides the add button when problem state is resolved or closed , because when problem is resolved or closed active field becomes false and the condition evaluates to true which hides the Add button.
you would need to modify this OOB condition
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 01:59 AM
Hello @Harish KM
Thank you! But it is for only Change request and service offering .
For incident , Affected CIs, there are now condition as parent.active == true
For cmdb_ci , condition is
For Incident
How to add condition

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 02:22 AM
Hi @Asha Pathak can you paste the script include of the function canShowRelatedListUiAction here, you would need to modify the script accordingly to show button
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 02:26 AM - edited 04-01-2024 02:27 AM
Hi @Asha Pathak I checked OOB script include and found out the below function is called into incidentUtils script include, you would need to modify BulkAddIncidents script include and remove parent.active == true from below script for add button to be visible
Harish