# File upload scenario through Jenkins using Newman API options

**URL:** <https://community.postman.com/t/file-upload-scenario-through-jenkins-using-newman-api-options/32864>\
**Category:** Help Hub\
**Tags:** newman-project, jenkins\
**Created:** [February 23, 2022, 2:09pm UTC](https://community.postman.com/t/file-upload-scenario-through-jenkins-using-newman-api-options/32864 "2022-02-23T14:09:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishna.arora](https://avatars.discourse-cdn.com/v4/letter/k/dec6dc/32.png) [@krishna.arora](https://community.postman.com/u/krishna.arora)\
**Post date:** [February 23, 2022, 2:09pm UTC](https://community.postman.com/t/file-upload-scenario-through-jenkins-using-newman-api-options/32864/1 "2022-02-23T14:09:43Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

Hi All,

I am new to postman and working on the scenario to upload file with api and run through jenkins. We are using the bit bucket as repositories and using the newman api options to run the postman collection. Please find the below newman code:

await postman({  
collection: [url to postmanCollection],  
environment: [postmanEnvironment],  
iterationData: [url to postmanDataFile],  
reporters: [‘cli’, ‘json’, ‘htmlextra’],  
reporter: {  
json: {  
export: `results.json`  
},  
htmlextra: {  
export: `results.html`  
}  
}

if we are placing the files in git repo (same as the collection json file), I am getting the 500 response.

Collection.json screenshot:

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/e/ebff7acc3fe370a36b546c353eb5cf1fe38a19b1.png)

Response screenshot:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/3/b/3b63522398652501eea3b05b10bd15eccf700681.png)

Can anyone please let me know what can I do to run the file upload scenario through Jenkins. can we set url as workingDir option in newman command ?

Note: we are using the newman api options to run the collection. so how can we set the workingDir option as url.

---

<div class="post-metadata">

**Author:** ![jonico-postman](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/jonico-postman/32/14924_2.png) [@jonico-postman](https://community.postman.com/u/jonico-postman)\
**Post date:** [February 17, 2023, 11:01am UTC](https://community.postman.com/t/file-upload-scenario-through-jenkins-using-newman-api-options/32864/2 "2023-02-17T11:01:39Z")

</div>

I created an example Jenkinsfile that is making use of the postman-cloud reporter plugin and some additional ones showing how to upload results using newman and postman: [Jenkinsfile showing advanced Postman CLI and newman integration including custom reporters and reporting status back to Postman · GitHub](https://gist.github.com/jonico/819d379a250af28ffc86f9c93283226c)

---

<div class="post-metadata">

**Author:** ![pberdnyk](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pberdnyk](https://community.postman.com/u/pberdnyk)\
**Post date:** [February 7, 2024, 8:59pm UTC](https://community.postman.com/t/file-upload-scenario-through-jenkins-using-newman-api-options/32864/3 "2024-02-07T20:59:13Z")

</div>

I still did not get it.  
I’m in a similar situation but I have all the tests in Postman and Jenkins uses Postman API to get collections and environment variables.  
Images for upload are loaded to the Postman cloud.  
Locally all good. But tests failed on Jenkins with error like  
│ ‘Form param `file`, file load error: “postman-cloud://  
│ /{{fileID}}”, no such file’

Can someone suggest how to handle it?
