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:

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 ""}"
parameter "number"="{number of relevant Fixlets of sites ""}"
parameter "headers"="{concatenation "|" of names of headers of fixlets whose (relevance of it) of sites ""}"
parameter "valueSCMIDHeader"="{concatenation "|" of values of headers "x-fixlet-scm-id" of fixlets whose (relevance of it) of sites ""}"