I wanted to use curl to create a filter for our Jira system and set shares in one go.
form this post (https://answers.atlassian.com/questions/173249) on the Atlassian-Answers site I understood that this is not possible with only the using the restAPI. So I tried using the code that the asker posted.
If I use this line:
.\cURL\bin\curl.exe -s -c cookie.txt -S -u %USERNAME%::%PASSWORD% %JiraServer%/secure/Dashboard.jspa
My script always exits, telling me that the syntax is incorrect. I never worked with curl before, but by only using the documentations from jira(login) and curl (commandlist) I can't find the problem.
My only idea is that there might be a problem with the address, but I cant think of what the problem should be.
EDIT:
for %%f in (.\Filters\*) do (
powershell -Command "(Get-Content "%%f") | ForEach-Object { $_ -replace \"%%PROJECT%%\", \"%PROJECT%\" } | Set-Content %TEMP_FILE%"
powershell -Command "(Get-Content \"%TEMP_FILE%\") | ForEach-Object { $_ -replace \"%%COMPONENT%%\", \"%COMPONENT%\" } | Set-Content %TEMP_FILE%"
pause
.\cURL\bin\curl.exe -s -c cookie.txt -S -u MYUSERNAME::MYPASSWORD JIRA_ADDRESS
pause
.\cURL\bin\curl.exe -s -b cookie.txt -S %JiraServer%/rest/api/latest/filter -X POST -H "Content-Type: application/json" --data @%TEMP_FILE%
pause
.\cURL\bin\curl.exe -s -b cookie.txt -S %JiraServer%/secure/EditFilter.jspa -X POST --data @%ShareFile%'
::.\cURL\bin\curl.exe -u %USERNAME%:%PASSWORD% -X POST --data @%TEMP_FILE% -H "Content-Type: application/json" %URL%
)
That is the whole code involved with the calls, it exits at the first curl call. If I run the exact same Code as the first curl call on the shell I get a response, if I use it inside the file I get syntax of command incorrect