I have used below lines to attach single report as email body and it works as expected through jenkins.
def report=build.getWorkspace().child("target/reports/report.html")
msg.setContent(report.readToString(),"text/html")
There are many files in the reports directory which starts with report1.html, report2.html etc., I just want to fetch all and show it as email content as I did before.
The html reports are dynamically generated,and there is a only way to identify that the html starts with "report".
Anyone ideas....
I didnt try but since readToString() returns a string, its maybe possible to concatenate all reports to a single string, and then pass it to the setContent() method: