Groovy append error

Can anyone help me with this please?

I have Groovy code:

    resultsSummaryForEmail = '<h3>xml files that passed:</h3>'
    passedXml.each { String filePath ->

where passedXml is a list of strings (file paths).

But that gives me error:

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: java.lang.String.append() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [<snip>
Possible solutions: expand(), expand(int), find(), any(), lines(), grep()

Can you try using resultsSummaryForEmail.append("${filePath}\n".toString())

It is very explicit about the problem, you are trying to call .append() method on a string, and there is simply no such method. You can just use a += instead
resultsSummaryForEmail += "${filePath}\n"

FWIW, a simpler thing to do would be:

String resultsSummaryForEmail = """
<h3>xml files that passed:</h3>

(note, this will add a newline at start and end, you can remove it if you dont want them there

@slide_o_mix @mlasevich Thanks for your help.