filter the configuration item based on the environment

Arun Priya
Tera Contributor

When the environment is chose as prod. It should not display list of configuration item were its evironment is development, others should be show.

to give in variable the filter it has predefined configuration which will be conflicted.
Please let me how to proceed with this.

 

14 REPLIES 14

@Arun Priya 

then do this in ref qualifier of that dictionary override

Give correct field name and choice value from CHG table.

javascript: var query = ''; if(current.fieldName == 'production') query = 'environment!=Production'; query;

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

@Ankur Bawiskar 
I tried but showing error. Attached the screenshot.

ArunPriya_0-1752762681371.png

 

@Arun Priya 

do you want to append the previous filter along with this one?

if yes then do this, please enhance as per your requirement

javascript: var query = ''; if(current.u_environment == 'production') query = new TaskUtils().getConfigurationItemFilter(current) + '^environment!=Development'; query;

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

@Ankur Bawiskar 

It doesn't work can we do it client script?

 



@Arun Priya 

It should work fine.

You cannot apply filter via client script, you can just validate and throw error.

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