0
votes

I'm trying to run the following command in jenkins pipeline code

def response="curl -D- -u 'AAA:AAA' -X POST -H 'X-Atlassian-Token:nocheck' -F 'file=@${workspace}\test.txt' http://localhost:8080/rest/api/2/issue/AAA-98/ attachments" println response bat "${response}"

getting following error,

def response="curl -D- -u 'AAA:AAA' -X POST -H 'X-Atlassian-Token:nocheck' -F 'file=@${workspace}\test.txt' http://localhost:8080/rest/api/2/issue/AAA-98/attachments" println response bat "${response}"

d:\jenkins\workspace\My>curl -D- -u 'AAA:AAA' -X POST -H 'X-Atlassian-Token:nocheck' -F 'file=@d:\jenkins\workspace\My est.txt' http://localhost:8080/rest/api/2/issue/AAA-98/attachments % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0HTTP/1.1 100 Continue

curl: (6) Could not resolve host: est.txt'

100 155 0 0 0 155 0 9687 --:--:-- --:--:-- --:--:-- 9687 curl: (26) read function returned funny value

1
"file=@d:\jenkins\workspace\My est.txt"Joao Vitorino

1 Answers

0
votes

You need to escape the \t inside @${workspace}\test.txt.

The correct one should be @${workspace}\\test.txt