# How to add a table to an email with the build result?

**URL:** <https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689>\
**Category:** Ask a question\
**Created:** [March 2, 2022, 1:17pm UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689 "2022-03-02T13:17:20Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 2, 2022, 1:17pm UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/1 "2022-03-02T13:17:20Z")

</div>

I have a problem. In Jenkins, I run automatic tests using Postman. When the build is done, an e-mail notification is sent with an attachment with the logs. In Jenkins, Newman returns me a table with the results:

I would like only such a table with the result to be in the e-mail. [table](https://i.stack.imgur.com/Y9lmh.png)

I did more or less as it is given here, but I don’t know what to enter in the attachemnt field. I typed testreport.html and created a Workspace file with the same name, but after building it is empty

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [March 2, 2022, 6:27pm UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/2 "2022-03-02T18:27:44Z")

</div>

I don’t know about about sending out emails, so I can’t directly help.

That being said, more information would be useful.

Are you using freestyle or pipeline?  
What step/script/etc are you using to send out emails (there’s a few options for sending them out).  
Do you have the “table” writing to a file already? or do you need help with that?

More data is more better.

---

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 3, 2022, 7:41am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/3 "2022-03-03T07:41:35Z")

</div>

hi @halkeye, thanks for the quick reply.

The project looks exactly the same as described here:

> **[Integrating with Jenkins](https://learning.postman.com/docs/running-collections/using-newman-cli/integration-with-jenkins/)**

Are you using freestyle or pipeline? - freestyle

What step/script/etc are you using to send out emails (there’s a few options for sending them out). - Email Extension - Jenkins Plugins

Do you have the “table” writing to a file already? or do you need help with that? - I made the table as it is given here (I copied and edited a little)

I created a file in the workspace called testrpr.html but it creates an empty one and the e-mail has a “white field”

![testrepr](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/d/d8a10dad3052e18b754c8e4190f187da77654d99.png)

**The main goal:** so after a build I get a log file, from that file I want to extract a table of fail/pass tests and place it inside the mail. The whole log file could be attached to a mail if any of the test scipts would fail.

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [March 3, 2022, 8:00am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/4 "2022-03-03T08:00:50Z")

</div>

> [@dawid](#):
>
> Are you using freestyle or pipeline? - freestyle

We will have to reach out to them. Freestyle is way less flexible and hasn’t been the recommended solution for a while now. Highly recommend pipeline. Pipeline is pretty simple with node. If you have a public repo I might even be up for submitting a pr with a jenkinsfile

> [@dawid](#):
>
> created a file in the workspace called testrpr.html but it creates an empty one and the e-mail has a “white field”

I’m still confused. Can you confirm via shell (I think it’s called execute shell step) that the file exists and isn’t 0 bytes.

Cause I’m not sure if the problem is that it’s not emailing correctly or not generating the file correctly.

Also can you screenshot your email section of the job and post it for us to see?

---

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 3, 2022, 8:43am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/5 "2022-03-03T08:43:43Z")

</div>

@halkeye

hmm, maybe i’ll use a plugin to convert freestyle to pipeline and then send you a jenkinsfile? I don’t know where I can find (and is there any jenksinfile in the freestyle project)

**I’m still confused. Can you confirm via shell (I think it’s called execute shell step) that the file exists and isn’t 0 bytes.** - ` -rw-r--r-- 1 root root 0 03-02 12:40 testrepr.html`

**Cause I’m not sure if the problem is that it’s not emailing correctly or not generating the file correctly.** - after a build I get a log file, from that file I want to extract a table of fail/pass tests and place it inside the mail. The whole log file could be attached to a mail if any of the test scipts would fail

**Also can you screenshot your email section of the job and post it for us to see?** -

 ![mail2](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/a/a5a2aed20443efa8466d6894519f240a7bff2221.png)

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [March 3, 2022, 9:06am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/6 "2022-03-03T09:06:14Z")

</div>

> [@dawid](#):
>
> **.** - ` -rw-r--r-- 1 root root 0 03-02 12:40 testrepr.html`

So that looks looks like the issue.your file is 0 bytes. The email is working fine.

> [@dawid](#):
>
> pipeline and then send you a jenkinsfile? I don’t know where I can find (and is there any jenksinfile in the freestyle project)

I think there has been a few attempts but I dont know of any good reliable converters. Pipeline isn’t hard learn.

---

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 3, 2022, 2:39pm UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/7 "2022-03-03T14:39:11Z")

</div>

Ok, let’s start from the beginning. I wrote a pipeline, downloaded the HTML Publisher plugin. Unfortunately I couldn’t find any report on the server `/var/reports/newman/html`

Pipeline:

```auto
pipeline {
    stage('Testy administracja DEV EU2') {
        steps {
            sh 'ssh -T -i /var/lib/jenkins/.ssh/id_rsa jenkins@127.0.0.1 newman run /files/testy_administracja.json -e /files/DEV.postman.environment.json -k -r junit,html --reporter-junit-export var/reports/newman/junit/newman.xml --reporter-html-export var/reports/newman/html/index.html'
            
            publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'var/reports/newman/html', reportFiles: 'index.html', reportName: 'Testy automatyczne', reportTitles: ''])
        }
    }
}

```

![Zrzut ekranu 2022-03-03 153727](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/1/1b67916f5dcfa1a793f2aa000e42d9919a472d6e.png)  
So now I need to add the e-mail code in the pipeline, but why the report hasn’t been done (on the server)?

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [March 3, 2022, 6:18pm UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/8 "2022-03-03T18:18:59Z")

</div>

> [@dawid](#):
>
> ` sh 'ssh -T -i /var/lib/jenkins/.ssh/id_rsa jenkins@127.0.0.1 newman run /files/testy_administracja.json -e /files/DEV.postman.environment.json -k -r junit,html --reporter-junit-export var/reports/newman/junit/newman.xml --reporter-html-export var/reports/newman/html/index.html'`

so it connects to another machine (jenkins@localhost, so itself?) then runs a command, and puts the files in var/reports/newman based on the home directory of the jenkins user?

Is the goal to escape a jenkins docker container or something? if so, you may want to add [jenkins@127.0.0.1](mailto:jenkins@127.0.0.1) as a ssh agent/node, and then you can select that agent via node, and not have to worry about passing data across ssh connection

> [@dawid](#):
>
> ` publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'var/reports/newman/html', reportFiles: 'index.html', reportName: 'Testy automatyczne', reportTitles: ''])`

then you publish the HTML of the files based on the $WORKSPACE/var/reports/newman/html of the job

Those paths are unlikely to match up.

If you can get away with not sshing things should work fine, if you must ssh, then you need to write to somewhere jenkins has access to, maybe somewhere related to $WORKSPACE?

As for the email, there’s a pipeline syntax generator link on the sidebar that will help you write new steps like email.

---

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 4, 2022, 6:32am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/9 "2022-03-04T06:32:05Z")

</div>

@halkeye

I deleted the ssh path (it’s on one machine).

Unfortunately in jenkins’ home directory I do not see the WORKSPACE of this pipeline. When I create a freestyle project, a directory in workspace is created.

If I want this report to be created in the pipeline workspace directory, it will be ok this way?

```auto

pipeline {
    stage('Postman tests') {
        steps {
            sh 'newman run /uusia/testy_administracja.json -e /uusia/DEV.postman.environment.json -k -r junit,html --reporter-junit-export var/reports/newman/junit/newman.xml --reporter-html-export var/reports/newman/html/index.html'
            
            publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '$WORKSPACE', reportFiles: 'index.html', reportName: 'Testy automatyczne', reportTitles: ''])
        }
    }
}

```

I don’t know how to complete these paths yet.

```auto
--reporter-junit-export var / reports / newman / junit / newman.xml
 --reporter-html-export var / reports / newman / html / index.html

```

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [March 4, 2022, 6:48am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/10 "2022-03-04T06:48:09Z")

</div>

> [@dawid](#):
>
> `reportDir: '$WORKSPACE'`

this probably won’t work. Single quotes means that groovy won’t interpret it, and let it gets passed into the next level. I doubt publishHTML handles variables. I don’t think you need the parameter. I think you should just have

```auto
reportDir: 'var/reports/newman/html'

```

Otherwise it seems okay to me.

Edit: Arg, i don’t have publishHTML installed to test it out

Okay, got it tested, took some creative liberties. The HTML is blank in the example collection i found online, but the junit XML works great

[https://ci.g4v.dev/job/demos/job/newman/](https://ci.g4v.dev/job/demos/job/newman/)

```auto
pipeline {
    agent {
        // // I don't have newman on my jenkins machine so using docker
        docker { 
            image 'node:lts'
            args '-e "HOME=$WORKSPACE"'
        }
    }
    stages {
        stage('Postman tests') {
            steps {
                sh '''
                  npm init -y
                  npm install newman newman-reporter-html
                  npx newman run \
                    "https://www.getpostman.com/collections/8a0c9bc08f062d12dcda" \
                    -r junit,html \
                    --reporter-junit-export var/reports/newman/junit/newman.xml \
                    --reporter-html-export var/reports/newman/html/index.html
                '''
            }
            // make sure we always attempt to parse the reports, even newman returns exit code other than 0
            post {
                always {
                    publishHTML([
                        allowMissing: false,
                        alwaysLinkToLastBuild: false,
                        keepAll: false,
                        reportDir: 'var/reports/newman',
                        reportFiles: 'index.html',
                        reportName: 'Testy automatyczne',
                        reportTitles: ''
                    ])
                    
                    junit allowEmptyResults: true, testResults: ' var/reports/newman/junit/newman.xml'
                }
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 4, 2022, 7:40am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/11 "2022-03-04T07:40:53Z")

</div>

Why can’t I see the directory “Tests administracja DEV EU 2 - Pipeline” in workspace (bash)? Others I can see (e.g. created by a freestyle project)

When I go to console output, I also do not see the tests being carried out. I can see them in the Freestyle project.

I also can’t see the HTML Reports tab: / …

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [March 6, 2022, 9:00pm UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/12 "2022-03-06T21:00:56Z")

</div>

> [@dawid](#):
>
> Why can’t I see the directory “Tests administracja DEV EU 2 - Pipeline” in workspace (bash)?

what does this mean? how are you checking? I’m not really sure I understand what isn’t working so can’t really give help.

---

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 7, 2022, 7:00am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/13 "2022-03-07T07:00:21Z")

</div>

When I go to build I don’t see more steps than “Start of Pipeline - (no timing in block)”.

in Bash in path /var/lib/jenkins/workspace I don’t see the directory of this pipeline -  
“Tests administracja DEV EU 2 - Pipeline”

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [March 7, 2022, 7:18am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/14 "2022-03-07T07:18:40Z")

</div>

> [@dawid](#):
>
> ```auto
> pipeline {
> stage('Postman tests') {
> steps {
> sh 'newman run /uusia/testy_administracja.json -e /uusia/DEV.postman.environment.json -k -r junit,html --reporter-junit-export var/reports/newman/junit/newman.xml --reporter-html-export var/reports/newman/html/index.html'
>             
> publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '$WORKSPACE', reportFiles: 'index.html', reportName: 'Testy automatyczne', reportTitles: ''])
> }
> }
> }
> 
> ```

I’m sorry, I assumed this was part of a larger pipeline that you spliced up, but as is, it isn’t valid. If you look at the console log for the build you should see error messages like below

[https://ci.g4v.dev/job/demos/job/dawid-newman/1/console](https://ci.g4v.dev/job/demos/job/dawid-newman/1/console)

```auto
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 2: Undefined section "stage" @ line 2, column 5.
       stage('Postman tests') {
       ^

WorkflowScript: 1: Missing required section "stages" @ line 1, column 1.
   pipeline {
   ^

WorkflowScript: 1: Missing required section "agent" @ line 1, column 1.
   pipeline {
   ^

```

At the very least, you need an agent and stages

```auto
pipeline {
    agent any
    
    stages {
        stage('Postman tests') {
            steps {
                sh 'newman run /uusia/testy_administracja.json -e /uusia/DEV.postman.environment.json -k -r junit,html --reporter-junit-export var/reports/newman/junit/newman.xml --reporter-html-export var/reports/newman/html/index.html'
                
                publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '$WORKSPACE', reportFiles: 'index.html', reportName: 'Testy automatyczne', reportTitles: ''])
            }
        }
    }   
}

```

The above runs on my server - [demos » dawid-newman #3 Console [Jenkins]](https://ci.g4v.dev/job/demos/job/dawid-newman/3/console) - though I don’t have newman installed, so it fails on the sh() step.

My version of the pipeline (in the previous post, using docker) does run - [demos » halkeye-newman #1 Console [Jenkins]](https://ci.g4v.dev/job/demos/job/halkeye-newman/1/console) but I don’t have your newman configs to confirm anything else.

I’d really appreciate your full pipeline and console logs if your comfortable sharing because something is breaking and its hard to guess what.

---

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 7, 2022, 7:54am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/16 "2022-03-07T07:54:47Z")

</div>

Just on Friday I added the agent any section to the pipeline. My pipeline is what you have in total, I post here how it looks:

```auto
 pipeline {
    agent { any
        }
    }
    stages {
        stage('Postman tests') {
            steps {
                sh '''
                  npm init -y
                  npm install newman newman-reporter-html
                  npx newman run \
                    "/uusia/testy_administracja.json -e /uusia/DEV.postman.environment.json -k 
" \
                    -r junit,html \
                    --reporter-junit-export var/reports/newman/junit/newman.xml \
                    --reporter-html-export var/reports/newman/html/index.html
                '''
            }
            post {
                always {
                    publishHTML([
                        allowMissing: false,
                        alwaysLinkToLastBuild: false,
                        keepAll: false,
                        reportDir: '/var/reports/newman',
                        reportFiles: 'index.html',
                        reportName: 'Testy automatyczne',
                        reportTitles: ''
                    ])
                    
                    junit allowEmptyResults: true, testResults: '/var/reports/newman/junit/newman.xml'
                }
            }
        }
    }

```

` Log: java.lang.NoSuchMethodError: No such DSL method 'stages' found among steps [addBadge, addErrorBadge, addHtmlBadge, addInfoBadge, addShortText, addWarningBadge, archive, bat, build, catchError, checkout, createSummary, deleteDir, dir, echo, emailext, emailextrecipients, error, fileExists, getContext, git, input, isUnix, junit, load, lock, mail, milestone, node, parallel, powershell, publishChecks, publishHTML, pwd, pwsh, readFile, release, removeBadges, removeHtmlBadges, removeSummaries, retry, sh, sleep, stage, stash, step, svn, timeout, timestamps, tm, tool, unarchive, unstable, unstash, waitUntil, warnError, withChecks, withContext, withCredentials, withEnv, withGroovy, wrap, writeFile, ws] or symbols [GitUsernamePassword, all, allBranchesSame, always, ant, antFromApache, antOutcome, antTarget, apiToken, architecture, archiveArtifacts, artifactManager, audit-trail, authorizationMatrix, batchFile, bitbucketServer, booleanParam, brokenBuildSuspects, brokenTestsSuspects, buildButton, buildDiscarder, buildDiscarders, buildRetention, buildTimestamp, buildTimestampExtraProperties, buildUser, builtInNode, caseInsensitive, caseSensitive, certificate, chlAtuoAction, choice, choiceParam, cleanWs, clock, command, configFile, configFileProvider, credentials, cron, crumb, culprits, default, defaultFolderConfiguration, defaultView, demand, developers, disableConcurrentBuilds, disableResume, dockerCert, dockerServer, dockerTool, downstream, dumb, durabilityHint, email-ext, envInject, envVars, envVarsFilter, executor, extendedEmailPublisher, file, fileParam, filePath, fingerprint, fingerprints, frameOptions, freeStyle, freeStyleJob, fromDocker, fromScm, fromSource, git, gitBranchDiscovery, gitHubBranchDiscovery, gitHubBranchHeadAuthority, gitHubExcludeArchivedRepositories, gitHubExcludeForkedRepositories, gitHubExcludePublicRepositories, gitHubForkDiscovery, gitHubIgnoreDraftPullRequestFilter, gitHubPullRequestDiscovery, gitHubSshCheckout, gitHubTagDiscovery, gitHubTopicsFilter, gitHubTrustContributors, gitHubTrustEveryone, gitHubTrustNobody, gitHubTrustPermissions, gitParameter, gitTagDiscovery, gitUsernamePassword, github, githubProjectProperty, githubPush, globalConfigFiles, groovy, headRegexFilter, headWildcardFilter, hyperlink, hyperlinkToModels, inheriting, inheritingGlobal, installSource, javadoc, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobBuildDiscarder, jobName, junitTestResultStorage, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, list, local, location, logRotator, loggedInUsersCanDoAnything, mailer, masterBuild, maven, maven3Mojos, mavenErrors, mavenGlobalConfig, mavenMojos, mavenWarnings, myView, namedBranchesDifferent, nodeProperties, nodejs, nodejsci, nonInheriting, none, organizationFolder, overrideIndexTriggers, paneStatus, parameters, password, pattern, permanent, pipeline, pipelineTriggers, plainText, plugin, pollSCM, projectNamingStrategy, proxy, pruneTags, queueItemAuthenticator, quietPeriod, rateLimit, rateLimitBuilds, recipients, requestor, resourceRoot, retainOnlyVariables, run, runParam, sSHLauncher, schedule, scmRetryCount, scriptApproval, scriptApprovalLink, search, security, shell, simpleBuildDiscarder, slave, sourceRegexFilter, sourceWildcardFilter, ssh, sshPublicKey, sshPublisher, sshPublisherDesc, sshTransfer, sshUserPrivateKey, standard, status, string, stringParam, suppressAutomaticTriggering, swapSpace, teamSlugFilter, text, textParam, timestamper, timestamperConfig, timezone, tmpSpace, toolLocation, unsecured, untrusted, upstream, upstreamDevelopers, userSeed, usernameColonPassword, usernamePassword, viewsTabBar, weather, withAnt, workspace, x509ClientCert, zip] or globals [currentBuild, env, manager, params]` `

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [March 7, 2022, 8:20am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/17 "2022-03-07T08:20:40Z")

</div>

> [@dawid](#):
>
> ```auto
> agent { any
> }
> }
> 
> ```

You have 1 open and 2 close braces here. If you clean that up it should run

---

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 7, 2022, 9:00am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/18 "2022-03-07T09:00:38Z")

</div>

Ok, build is successfulbut nothing happened

**Log:**  
Uruchomiono przez użytkownika [Dawid] [Pipeline]  
End of Pipeline  
Finished: SUCCESS

only 1 step: Start of Pipeline - no timing in block.

Pipeline:

```auto

pipeline {
    agent { any
        }
    stages {
        stage('Postman tests') {
            steps {
                sh '''
                  npm init -y
                  npm install newman newman-reporter-html
                  npx newman run \
                    "/uusia/testy_administracja.json -e /uusia/DEV.postman.environment.json -k" \
                    -r junit,html \
                    --reporter-junit-export var/reports/newman/junit/newman.xml \
                    --reporter-html-export var/reports/newman/html/index.html
                '''
            }
            post {
                always {
                    publishHTML([
                        allowMissing: false,
                        alwaysLinkToLastBuild: false,
                        keepAll: false,
                        reportDir: '/var/reports/newman',
                        reportFiles: 'index.html',
                        reportName: 'Testy automatyczne',
                        reportTitles: ''
                    ])
                    
                    junit allowEmptyResults: true, testResults: '/var/reports/newman/junit/newman.xml'
                }
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![dawid](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dawid](https://community.jenkins.io/u/dawid)\
**Post date:** [March 8, 2022, 9:10am UTC](https://community.jenkins.io/t/how-to-add-a-table-to-an-email-with-the-build-result/1689/19 "2022-03-08T09:10:34Z")

</div>

> [@dawid](#):
>
> build is successfulbut nothing happened

This Pipeline has run successfully, but does not define any stages. Please use the `stage` step to define some stages in this Pipeline.
