Running Bamboo 5.15.3 and just got Pre-Post Build Command runner installed and trying to use it to create a jira bug upon failed buid. Bamboo is on a windows server and wanting to execute the command on the server, not a remote. Running the following command
"C:\Program Files\CustomMEM\Executables\curl" -D- -u username:password -X POST -d "{\"fields\": {\"project\": {\"key\": \"MATH\"}, \"summary\": \"${bamboo.buildPlanName} - Build: ${bamboo.buildNumber} Change List: ${bamboo.repository.revision.number}\", \"description\": \"Link to the failed build: ${bamboo.buildResultsUrl}\", \"issuetype\": {\"name\": \"Bug\"}}}" -H "Content-Type: application/json" https://<jiraServer>/rest/api/2/issue/
When I run the build it bombs out with
curl: (6) Could not resolve host: "summary"
28-Apr-2017 10:17:57 curl: (3) Port number ended with ' '
28-Apr-2017 10:17:57 curl: (6) Could not resolve host: "description"
28-Apr-2017 10:17:57 curl: (3) Port number ended with ' '
28-Apr-2017 10:17:57 curl: (6) Could not resolve host: "issuetype"
28-Apr-2017 10:17:57 curl: (3) [globbing] unmatched brace in column 1
28-Apr-2017 10:17:57 curl: (3) [globbing] unmatched close brace/bracket in column 6
So I took the command that was generated after Bamboo subsititued the variables and ran it on command line and it worked perfectly.
Any and all help would be appreciated and thanks in advance!
Hi Matt!
Thanks for your Question. It looks like the issue here is that the quotes inside the data (eg: \"fields\") are not being properly escaped for the Script task.
Could you please try the following:
"C:\Program Files\CustomMEM\Executables\curl" -D- -u username:password -X POST -d "{\\\"fields\\\": {\\\"project\\\": {\\\"key\\\": \\\"MATH\\\"}, \\\"summary\\\": \\\"${bamboo.buildPlanName} - Build: ${bamboo.buildNumber} Change List: ${bamboo.repository.revision.number}\\\", \\\"description\\\": \\\"Link to the failed build: ${bamboo.buildResultsUrl}\\\", \\\"issuetype\\\": {\\\"name\\\": \\\"Bug\\\"}}}" -H "Content-Type: application/json" https://<jiraServer>/rest/api/2/issue/
"C:\Program Files\CustomMEM\Executables\curl" -D- -u username:password -X POST -d '{\"fields\": {\"project\": {\"key\": \"MATH\"}, \"summary\": \"${bamboo.buildPlanName} - Build: ${bamboo.buildNumber} Change List: ${bamboo.repository.revision.number}\", \"description\": \"Link to the failed build: ${bamboo.buildResultsUrl}\", \"issuetype\": {\"name\": \"Bug\"}}}' -H "Content-Type: application/json" https://<jiraServer>/rest/api/2/issue/
Thanks!
Elias
Bamboo Support
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.