Session relevance in action script

I am trying to get the compliance status of a Fixlet from the action script of another Task.
Here is my code which is failing with error Command failed (Relevance substitution failed):

parameter “result”="{(if (relevant (bes computer whose (name of it = “xyz”)) of bes fixlet whose (mime field “x-fixlet-scm-id” of it = “guid_of_fixlet”)) then “TRUE” else “FALSE”)}"

Does such kind of session relevances are not allowed in action script ?

(Relevance works fine on presentation debugger of console)

Ahhh yes.
Client relevance works on BigFix clients/agents.
Session Relevance works in the Bigfix console, web reports, REST API, webui and other server side spaces against the data collected by the agents and inserted into BFEnterprise.

You can filter the inspector search to omit Session Relevance and thus see what objects are available in Client Relevance for Fixlet Object:
https://developer.bigfix.com/relevance/search/?query=fixlet&platform=aix%2Chp-ux%2Cmac%2Credhat%2Csuse%2Csolaris%2Cwindows%2Cdebian%2Cubuntu%2Craspbian%2Ccentos%2Coracleenterprise%20linux%2Camazonlinux%202%2Clinux

In theory, you should be able to check one Fixlet’s relevance from another Fixlet, but it is disabled in the context of Fixlet Relevance (only allowed in Analysis).
Action Script is allowed though, so relevance substitution should work.

It is a little tricky to work with, so here is an example action script. you can see the “results” of each parameter in the Client Log. Should be enough to get you started. (I used BES Support site because everyone has that one. You will need to use the proper site URL in your version)

parameter "names"="{concatenation "|" of urls of sites}"
parameter "sitename"="{names of sites "http://sync.bigfix.com/cgi-bin/bfgather/bessupport"}"
parameter "number"="{number of relevant Fixlets of sites "http://sync.bigfix.com/cgi-bin/bfgather/bessupport"}"
parameter "headers"="{concatenation "|" of names of headers of fixlets whose (relevance of it) of sites "http://sync.bigfix.com/cgi-bin/bfgather/bessupport"}"
parameter "valueSCMIDHeader"="{concatenation "|" of values of headers "x-fixlet-scm-id" of fixlets whose (relevance of it) of sites "http://sync.bigfix.com/cgi-bin/bfgather/bessupport"}"
2 Likes