Relevance - Action status report

I’m trying to modify this relevance query to add an additional column “Computer Group”. If i replace “name of computers” with “names of bes computer groups” it successfully returns the groups names. However, i have not been able to figure out how to include both. Looking for some help

<?relevance
(html "<table id=resultsTable class=sortable>" & html ("<th>Issuer</th><th>Action ID</th><th>State</th><th>Baseline Name</th><th>Start Date</th><th>Name of Failed Patch</th><th>Computer Name</th><th>Computer Group</th>") & 

(it) & html "</table>"

) of concatenations of trs of (

td of (item 0 of it) & 
td of (item 1 of it) & 
td of (item 2 of it) & 
td of (item 3 of it) & 
td of (item 4 of it) & 
td of (item 0 of item 5 of it) & 
td of (item 1 of item 5 of it) 

) of (

name of issuer of it, 
id of it as string, 
state of it, 
name of it, 
time issued of it as string, 
((names of it, names of computers of results whose 
(exists statuses whose (it as string as lowercase = "failed") of it) of it) of member actions 
whose (exists statuses whose (it as string as lowercase = "failed") of results of it) of it)

) of bes actions whose (

exists multiple flag of it AND 
name of it as lowercase contains "win action" as lowercase AND 
state of it is contained by "Open|Expired|Stopped" 

)

?>

To do that, you have to change your ‘computer’ lookup so that it gives both the computer name, and some concatenation of the names of groups in which it is a member. In doing that, you change your ‘item 5’ from a tuple of (action name, computername) into a tuple of tuples showing (actionname, (computername, computergroupnames)).

This change carries forward to where you’re retrieving the ‘td of (item)’ entries so now you need a td of (item 0 of item 1 of item 5 of it) for the computername and a td of (item 1 of item 1 of item 5 of it) for the computer groups names.

(html "<table id=resultsTable class=sortable>" & html ("<th>Issuer</th><th>Action ID</th><th>State</th><th>Baseline Name</th><th>Start Date</th><th>Name of Failed Patch</th><th>Computer Name</th><th>Computer Group</th>") & 

(it) & html "</table>"

) of concatenations of trs of (

td of (item 0 of it) & 
td of (item 1 of it) & 
td of (item 2 of it) & 
td of (item 3 of it) & 
td of (item 4 of it) & 
td of (item 0 of item 5 of it) & 
td of (item 0 of item 1 of item 5 of it) &
td of (item 1 of item 1 of item 5 of it) 

) of (

name of issuer of it, 
id of it as string, 
state of it, 
name of it, 
time issued of it as string, 
((names of it, (names of it, concatenation ";" of names of bes computer groups of it) of computers of results whose 
(exists statuses whose (it as string as lowercase = "failed") of it) of it) of member actions 
whose (exists statuses whose (it as string as lowercase = "failed") of results of it) of it)

) of bes actions whose (

exists multiple flag of it AND 
(name of it as lowercase contains "win action" as lowercase) AND 
state of it is contained by "Open|Expired|Stopped" 

)
1 Like