Hi, I am looking for some review and guidance on the following relevance which looks for two custom client settings and should result to false if either one if present but in my case, relevance is only checking the first setting and ignoring the 2nd one.
I used Fixlet debugger to test this relevance and it results to True even though both client settings are present on the client and have the values as checked by this relevance.
When I test these separately, both results to False.
(exists true whose (if true then (not exists (if exist values of settings “Organization” of client then value of setting “Organization” of client else error “not set”) whose (it as string as lowercase contains “XYZ” as lowercase)) else false)) OR (exists true whose (if true then (not exists (if exist values of settings “EXCLUDED” of client then value of setting “EXCLUDED” of client else error “not set”) whose (it as string as lowercase contains “YES” as lowercase)) else false)
If you’re just trying to return false if either of those settings exists, you can just do:
`
not exist setting “Organization” of client AND not exist setting “EXCLUDED” of client
If you need to check for specific values for those, then use:
not exist setting “Organization” whose (value of it as string= “somevalue1”) of client AND not exist setting “EXCLUDED” whose (value of it as string= “somevalue2”) of client
But if I use AND instead of OR, isn’t relevance going to check both settings and will be only relevant if both settings are either missing or have different values then in the script.
I am looking for relevance to be true if any of the setting is missing or have the same value as indicated in the relevance script.
That’s correct. I was only going off the condition: “looks for two custom client settings and should result to false if either one if present”.
The relevance you currently have is quite difficult to read to interpret the desired outcome. Simple ORs and ANDs should get you your desired result.
If your conditions are:
true if any of the setting is missing
true if any of the settings matches some value
Then you are doing:
(condition1) OR (condition2)
Which you can achieve with this:
(not exist setting “Organization” of client OR not exist setting “EXCLUDED” of client) OR (exist setting “Organization” whose (value of it as string= “somevalue1”) of client OR exist setting “EXCLUDED” whose (value of it as string= “somevalue2”) of client)
I too am not sure I understand the ask…if this should be relevant on "any machine missing “Organization”, except those that are “EXCLUDED”, then I think @bma’s relevance here would do it for you.
Basically I have a policy which applies relay auto select setting on end-points. I want to have end-points avoid this policy if those end-points belongs to a certain Organization (via the manual Organization client setting) or if they are excluded by the manual client setting
Ah, thanks, that’s much more clear. I think this should do it, please let us know the results…
not (exists setting "Organization" whose (exists value of it) of client and exists setting "Excluded" whose (exists value of it) of client) or not ( exists setting "Organization" whose (value of it = "XYZ") of client or exists setting "Excluded" whose (value of it = "Yes") of client)