How to insert external data in the Jenkins email report?

1.6k Views Asked by At

Is it possible to pass data generated by the script executed in the 'Execute shell' build step and insert it into the email report. I'm using the email-ext plugin and a Jelly template.

2

There are 2 best solutions below

0
On BEST ANSWER

Use EnvInject plugin to propagate your variables "to the outside". Here is how you can do it.

0
On

I use groovy-based email template. See below what I've found. Maybe it will be helpful in Jelly templates as well:

<%
    import hudson.model.*

    def YOUR_VARIABLE= build.getEnvVars()["SOME_BUILD_PARAMETER"];
%>

Then you can use

${YOUR_VARIABLE}