We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

How to add a 'Default filter' to the 'Affected CIs' related list to the 'Add' button

harinalamalapu
Giga Expert

Hello Community,

I am trying to filter out the Configuration Items (CIs) with empty names in both 'Edit' Slush bucket and 'Add' button sys popup window of 'Affected CIs' related list. I am able to use the 'Default filter' from the List control of the 'Affected CIs' related list header, but I am trying to find ways to apply the same filter to the 'Add' button sys popup window under 'Affected CIs' related list.

Any thoughts?

I tried to add Default filter on the 'Add' button's sys popup of list hearer, but I couldn't add the 'Edit default filter' field to the form on this List control.

Thanks,

Hari

24 REPLIES 24

staceyrocheleau
Kilo Guru

Okay I just upgraded my dev instance to Geneva and I see it. Very interesting as when I upgraded, my edit button was now omitted and I see the "add" button.



The ui action calls the GlideAjax function AssociateCIToTask



I can't find anything you'd have to update other than modifying this somehow. Maybe someone else has an idea that is easier. You can disable the add button if you want to stay with the slushbucket edit as well.



P.S. You can create a default filter in Geneva using this step (only filters the displaying of the list.): Create a default filter


lionelcomandini
Tera Contributor

Hi Hari,



In case you cannot perform a CMDB clean up,



Please find the solution to add a default filter to the "Add" button of Affected CIs related list.



  1. Go on the script include "AssociateCIToTask"
  2. Add the encoded query needed (could be dynamic)
  3. Omit the edit button (the affected CI could be removed from the related list)


Customization :



Script Include : AssociateCIToTask



      var url = new GlideURL("task_add_affected_cis.do");


      url.set("sysparm_crSysId", chgReqId);


      url.set("sysparm_view", "associate_ci");


      url.set("sysparm_add_to", addToTable);


      url.set("sysparm_stack", "no");


      url.set("sysparm_table", latestClassAdded);


      url.set("sysparm_parent_class", parentClass);


      url.set("sysparm_query",'nameISNOTEMPTY'); // Add default filter - Name IS NOT Empty; could be dynamic if needed



      return url;



Result :



Default filter.png



Thanks,



Regards,


Lionel COMANDINI



ITEO


Skype : lionel.comandini.iteoconsulting


Email : lionel.comandini@iteoconsulting.com



Hello Lionel,



We have a filter defined in filter table. Can we use that filter in the script. We don't want to change the script instead we can change the filter under system definition->Filters that will change in the affected CI's.



Thank You


Could you tell how can we make sure that the filter which is applied " NameisNotEmpty" should be read only? No one should be able to modify it as now I can modify this filter.


If you want to stop them from editing it. When you click add and get the pop up, you can still edit the list control.



At the top of the list, right click --> Configure --> List Control -->



You can then assign "filter roles" (to give access to certain roles only) or check "omit filters" to omit the filter from the display.