Prakash Raj
Prakash Raj

Reputation: 159

How to Upload files using Talend tREST?

Experts,

I need to upload files using Talend tREST component to Zephyr/JIRA. I do not know the format/syntax to give in httpbody section like the curl's ( -F "[email protected]" )

URL
 https://localhost:4000/jira/rest/zapi/latest/attachment?  
 entityId=4783&entityType=TestStepResult

BODY
 D:/TestResults/QPJ-707_Count_Mismatch.xls

I gave the full path and file name in body section. When I run, I am getting ERROR_CODE = 500.

Please help on how to give filepath/filename in the body section in tREST.

I do not get enough information in Zephyr/Zapi API website.

thanks in Advance - PK

Now, I tried with tFileFetch with the parameters as shown in the pics.. but I still get "Method failed: HTTP/1.1 500 Internal Server Error". Could someone help on this please?

Pic1

Pic2

Upvotes: 3

Views: 7372

Answers (2)

Bharat Khanna
Bharat Khanna

Reputation: 21

In case if tFileFetch is not working for you, you can use tRest component to upload file to a rest api. An example is given here

Upvotes: 1

Balazs Gunics
Balazs Gunics

Reputation: 2067

You can use the tFileFetch component that allows you to download files, however in its advanced settings you can enable the "upload files" which then uploads the files. As a bonus it does it in a multi-part http post.

See more: https://help.talend.com/display/TalendComponentsReferenceGuide61EN/tFileFetch

Upvotes: 3

Related Questions