How to add filter condition in Impacted Services/CIs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2019 02:15 AM
Hi All,
I need to add filter condition in Impacted Services/CIs it is available in Change request related links
Change - > Impacted Services/CIs -> Click on Add
window is opened with CIs list, i want to exclude few classes from list(like software,AIX Server)
Thanks in advance...!
- Labels:
-
Best Practices
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2021 09:50 AM
Hello,
ADD Button is not like a traditional related list Button i.e. Edit, New. As the Add button opens up a Pop-up instead of a slush bucket so the default filters using List Controls don't work. The Good News is, this can be achieved by modifying the OOTB Script Include. [Make sure to Assess and accept/reject upgrades to this script include post upgrade]
Story
Put a Default Filter on Impacted CI's Related List on the Change Request form to show only those CI's which doesn't have STATUS = RETIRED when I click on ADD Button.
Solution
The backend functionality of the ADD button is controlled by a Script Include AssociateCItoTask. We are going to add an encoded query to apply as a filter.
1. Go to the cmdb_ci table and apply a filter on List based on your requirements. Right-click on the filter and select a copy query. This copied query will be used in the script include, in our next step.
2. Open the AssociateCItoTask Script include. Inside function _getUrl(), On line # 35, add the below line of the script.
url.set("sysparm_query", 'install_status!=7');
Please note - Line number can be different but make sure you group the above line with the existing url.set(..) method.
3. Save the Script Include and then open any change request. Scroll down to Impacted Services/CI related list and click on the ADD button. You will see a default filter there.
Hurrah! We are done. 🙂
If this was helpful, please make sure to give it a thumbs up [HELFPFUL]. Also, bookmark this for future reference.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 11:54 AM
One thing. You modify an OOB Script Include and you (or your client) will own that technical debt. However, the literal fact that to get a filter in for Retired you have to modify an OOB script is bogus. This needs to be in the filter table (sys_filter). Not in code.