REST API: Using computer group as target for an action

HI,

I have to push the actions via rest api using xml where i add the computer names or id in the target field. Using computer name and ids i am able to push the actions but my requirement is to push the actions via computers groups, means i have to mention computer group name in the target field of the action xml and once i post this xml it will get pushed on all the computers of that computer group. How can i parse this request?

you cant directly put computer group under computer name or ID, it should be passed under relevance filed of your xml with your computer group ID something like below & remove any target entry as well than push xml from API.

<Title>My Test Action</Title>
		<Relevance>exists true whose (if true then (member of group 1177 of sites) else false)</Relevance>

OR
<Relevance>exists true whose (if true then (member of group 1177 of site "XYZ") else false)</Relevance>
OR
<Relevance>member of group 1177 of site "XYZ"</Relevance>

2 Likes

Thanks @vk.khurava for your help

Picking up this topic again. Using the earlier example, I created a manual group called Dev and added 1 computer to it. The ID for that group is 432137. If I use exists true whose (if true then (member of group 432137 of sites) else false) no computers report as relevant for the action. Are manual groups somehow different?

You should try that in the Fixlet debugger or WebUI Query in “Evaluate as Client” mode.

I expect group 432137 of sites probably throws a Singular Expression error, as it’s using the singular “group” against the plural “sites”. I’ve always seen this expression use a specific site name.

Also Manual Groups don’t exist in content sites, they’d be in an operator site or master action site.

Ah, Manual Groups need a different relevance expression entirely. See Issuing a action to a manual group via REST api