Filter table based in array from system property

Nisha30
Kilo Sage

Hi ,

we have set many system properties which contains table names comma separated.

 

Example: hard.ci.pop 

Nisha30_0-1751290238016.png

1)need to call this property from Script Include

2) the result of this should be : 'Configuration Item' field should display records only from these tables.

 

How do I achieve this

 

Thanks

 

1 ACCEPTED SOLUTION

Hi @Nisha30 ,

 

 

in the question you have share the property screenshot value contains ";" at the end

remove the ";" at the end of the property value in the system property

 

update the ref qual as below

 

javascript: "sys_class_nameIN" + new global.getincTables().getTableNames(current.getValue('category'));

 

 

 

update/keep the script include method as below

 

getTableNames: function(chkcategory) {
    chkcategory = chkcategory.toLowerCase();
    if (chkcategory == 'hardware')
        return gs.getProperty('inc.filter.hardware');
    else if (chkcategory == 'software')
        return gs.getProperty('inc.filter.software')
    else if (chkcategory == 'exchange')
        return gs.getProperty('inc.filter.exchange')
    else
        return ''
}

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

 

View solution in original post

23 REPLIES 23

Hi @Nisha30 

You should put the gs.info message before the return statement 

move all the gs.info statements before to return statements

 

is the choice value correct the backend value? 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

hi @Chaitanya ILCR 

yes the logs shows all property values however in incident form the CI field does not reflect records

 

Thanks

Hi @Nisha30 ,

 

 

in the question you have share the property screenshot value contains ";" at the end

remove the ";" at the end of the property value in the system property

 

update the ref qual as below

 

javascript: "sys_class_nameIN" + new global.getincTables().getTableNames(current.getValue('category'));

 

 

 

update/keep the script include method as below

 

getTableNames: function(chkcategory) {
    chkcategory = chkcategory.toLowerCase();
    if (chkcategory == 'hardware')
        return gs.getProperty('inc.filter.hardware');
    else if (chkcategory == 'software')
        return gs.getProperty('inc.filter.software')
    else if (chkcategory == 'exchange')
        return gs.getProperty('inc.filter.exchange')
    else
        return ''
}

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

 

Hi @Chaitanya ILCR 

yes now it displays removing the semicolon from system properties.

 

Thanks all of very much your support in troubleshooting and resolving.

Thanks