Custom Web Report - Add Group Column

I’m attempting to add an additional column to this patch report. I want to return the group name as well. Jason, i’m trying to use what you had explained to me here Relevance - Action status report to help but i haven’t been successful. Is it the same approach?

td of (item 0 of it as string) & 
td of (item 1 of it as string) & 
td of (item 2 of it as string) & 
td of (item 3 of it as string) & 
td of ((year of it as string & "/" & (month of it as two digits) as string & "/" & (day_of_month of it as two digits) as string) )
  of (item 4 of it as date) & 
td of (item 5 of it as string)) of ((if (size of item 1 of it > 0) then ((names of elements of item 1 of it )) else ("<none>")), 

(if (exists Name of item 0 of it| false) then (concatenations "%0A" of (Name of item 0 of it as string)) else ("<none>")), 

(if (exists Source Severity of item 0 of it| false) 
then (concatenations "%0A" of (Source Severity of item 0 of it as string)) else ("<none>")), 

(if (exists Category of item 0 of it| false) then (concatenations "%0A" of (Category of item 0 of it as string)) else ("<none>")), 

(if (exists Source Release Date of item 0 of it) then (Source Release Date of item 0 of it as string)
 else ("Fri, 15 Feb 1980")), 

(if (exists CVE ID List of item 0 of it | false) then (concatenations "%0A" of (CVE ID List of item 0 of it as string)) else ("<none>"))) of (item 0 of it , 

intersection of (applicable computer set of item 0 of it; item 1 of it)) whose (size of item 1 of it > 0) of (elements of item 0 of it , item 1 of it) 

of (set of fixlets  of results of source fixlets of components of component groups of bes fixlets whose(baseline flag of it and name of it contains "Servers - Win"), union of member sets of bes computer groups whose (name of it as lowercase = "prod grp1"))

I think i’m getting closer but still can’t get my query to return results. I added some comments to show what i think each part of the query is doing:

td of (item 0 of item 1 of it as string) &  // Computer Name
td of (item 1 of item 1 of it as string) &  // Group Names
td of (item 2 of it as string) &            // Fixlet Name
td of (item 3 of it as string) &            // Severity
td of (item 4 of it as string) &            // Category
td of ((year of it as string & "/" & (month of it as two digits) as string & "/" & (day_of_month of it as two digits) as string)) of (item 5 of it as date) & // Release Date
td of (item 6 of it as string)              // CVE

) 

of (
(if (size of item 1 of it > 0) then ((names of elements of item 1 of it )) else ("<none>")), 

(concatenations "%0A" of (name of it & "%0A" & concatenation ";" of names of bes computer groups of it) of item 1 of it),  // Computer Details including Group Memberships

(if (exists Name of item 0 of it| false) then (concatenations "%0A" of (Name of item 0 of it as string)) else ("<none>")), // Fixlet Name

(if (exists Source Severity of item 0 of it| false) then (concatenations "%0A" of (Source Severity of item 0 of it as string)) else ("<none>")), 

(if (exists Category of item 0 of it| false) then (concatenations "%0A" of (Category of item 0 of it as string)) else ("<none>")), 

(if (exists Source Release Date of item 0 of it) then (Source Release Date of item 0 of it as string) else ("Fri, 15 Feb 1980")), 

(if (exists CVE ID List of item 0 of it | false) then (concatenations "%0A" of (CVE ID List of item 0 of it as string)) else ("<none>"))
) 

of (item 0 of it , 

intersection of (applicable computer set of item 0 of it; item 1 of it)) whose (size of item 1 of it > 0) of (elements of item 0 of it , item 1 of it) 

of (set of fixlets  of results of source fixlets of components of component groups of bes fixlets whose(baseline flag of it and name of it contains "Servers - Win"), union of member sets of bes computer groups whose (name of it as lowercase = "prod grp1"))

I think you missed copying something at the beginning of the query, I don’t see the parentheses lining up

(

(if (size of item 1 of it > 0) then ((name of it, concatenation ";" of names of bes computer groups of it) of elements of item 1 of it) else ("<none>", "<none>")),

(if (exists Name of item 0 of it| false) then (concatenations "%0A" of (Name of item 0 of it as string)) else ("<none>")), /* Fixlet Name */

(if (exists Source Severity of item 0 of it| false) then (concatenations "%0A" of (Source Severity of item 0 of it as string)) else ("<none>")), 

(if (exists Category of item 0 of it| false) then (concatenations "%0A" of (Category of item 0 of it as string)) else ("<none>")), 

(if (exists Source Release Date of item 0 of it) then (Source Release Date of item 0 of it as string) else ("Fri, 15 Feb 1980")), 

(if (exists CVE ID List of item 0 of it | false) then (concatenations "%0A" of (CVE ID List of item 0 of it as string)) else ("<none>"))
) 



of (
  item 0 of it , /* one fixlet */
  intersection of (applicable computer set of item 0 of it; item 1 of it) /* set of bes computers, all applicable to fixlet*/
  ) whose (size of item 1 of it > 0) of 
 (
  elements of item 0 of it , /* bes fixlet set */
  item 1 of it /* bes computer set */
 ) 

of (set of /* fixlets  of results of*/ source fixlets of components of component groups of bes fixlets whose(baseline flag of it and (TRUE or name of it contains "Servers - Win")), union of member sets of bes computer groups whose (TRUE or name of it as lowercase = "prod grp1"))

I think the complex part of this is that you want to unwind the set of applicable computers for the fixlet, and from those computers retrieve both their name and the names of their group memberships. That means you have to embed another tuple inside the lookup. At this point ‘item 1 of it’ refers to the set of applicable computers; you have to unwind it with ‘elements of item 1 of it’ from there retrieve either ‘name, groups’ or ‘none, none’ if the set is empty.

    (if (size of item 1 of it > 0) then ((name of it, concatenation ";" of names of bes computer groups of it) of elements of item 1 of it) else ("<none>", "<none>")),

Then when you go to format it it’ll be something like `td of item 0 of item 0 of it /name/, td of item 1 of item 0 of it /* computergroups /, td of item 1 of it / fixlet name*/, …

1 Like

Thanks Jason… appreciate the help as always and the detailed explanation.

1 Like