Can i add computer group name or id into the rest api call in below source fixlet?

can i add computer group name or id into the rest api call in below source fixlet ?

<?xml version="1.0" encoding="utf-8"?>
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SkipUI="true">
    <SingleAction>
        <Title>test action</Title>
        <Relevance>true</Relevance>
        <ActionScript>setting "test action"="{now as string}" on "{now}" for client</ActionScript>
        <SuccessCriteria />
        <Settings />
        <SettingsLocks />
        <Target>
            **<AllComputers>true</AllComputers>**
        </Target>
    </SingleAction>
</BES>

You need to use the <CustomRelevance> element then add relelvance to pull the group you wanted to target. Chek the BES.xsd for all avilable options via the REST API.

A previous posting that may be of help (found using the forum search feature) Api action/analysis using computer group - #5 by bigfixforum

1 Like

Hi, i tried <CustomRelevance> part but when i execute action it does not come up with server name in the target tab and action keep on blank state.

<CustomRelevance>*member of group 1930 of site "test" </CustomRelevance>*
or 

**<CustomRelevance>((Names of Members of it as string) of bes computer groups whose ((Name of it as lowercase = "test")))</CustomRelevance>**

<?xml version="1.0" encoding="UTF-8"?>
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">
    <SourcedFixletAction>
        <SourceFixlet>
            <Sitename>test</Sitename>
            <FixletID>1714</FixletID>
            <Action>Action1</Action>
        </SourceFixlet>
        <Target>
            **<CustomRelevance>((Names of Members of it as string) of bes computer groups whose ((Name of it as lowercase = "test")))</CustomRelevance>**
        </Target>
        <Parameter Name="Service_Name">bits</Parameter>
		<Parameter Name="Folder">c:\temp\test1</Parameter>
		</SourcedFixletAction>
</BES>

image

I beleive you need a boolean statement, plus it needs to be client relevance, not session relevance, similar to the example on the other forum posting. You can use the FixletDebugger in Client mode to test group detection relevance is returning the expected results

Q: member of group 13856 of site "CustomSite_MyCustomSite"
E: True
T: 0.020 ms
2 Likes

when i run in FixletDebugger in client mode , even though i have member into this automatic group it does not work and through Singular error expression

q:member of group 1930 of site "test"
E: Singular expression refers to nonexistent object.

q:exists true whose ( if true then ( member of group 1930 of site "test" ) else false )
A: False
T: 0.046 ms

On the client the site would be seen as site "CustomSite_test". I believe it’s also case-sensitive. It should appear the same way the site appears under the __BESData folder.

2 Likes

@JasonWalker, I think i missed out CustomSite site keywork in front of test site , thanks for highlighting that , it fixed for automatic group selection , but when i want to try with manual group it works in different way as mentioned in your previous link

q:member of group 1930 of site "CustomSite_test"
A: True
T: 0.042 ms


q:member of manual group "__Group_0_test1" of client
A: True
T: 0.031 ms

q:exists true whose ( if true then ( member of manual group "test1" of client ) else false )
A: False
T: 0.042 ms

q:exists true whose ( if true then ( member of manual group "__Group_0_test1" of client ) else false )
A: True
T: 0.039 ms