Hi,
When I tried to create an issuelink from REST API v4.4, I noticed that when you pass the credentials in your curl example, all works fine and the link is created. But when you use the cookie that's already set, it says "You don't have permission to view the specified issue". Certainly, I did verify that there is no session time-out.
Community moderators have prevented the ability to post new answers.
This was a bit tricky. I tried it out and have a guess as to what might be happening to you.
Try this, when logging in:
curl -c cookie.txt -H "Content-Type: application/json" -d '{"username" : "admin", "password" : "admin"}' http://localhost:8080/rest/auth/latest/session
Note in particular the "-c cookie.txt" section. I suspect your login wasn't actually writing out a cookie, but only giving the JSON response.
I've added a note to the documentation.
Thanks Jeremy. I was logging in using the exact same command as you suggested. But still I get the same Permission issue. I'm not sure where it went wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm doing my testing on localhost (a downloaded version), and not over https, but I got it working. Here's my exact syntax, for both commands:
curl -c cookie.txt -H "Content-Type: application/json" -d '{"username" : "admin", "password" : "admin"}' http://localhost:8080/rest/auth/latest/session curl -b cookie.txt -H "Content-Type: application/json" -d '{ "linkType": "Duplicate", "fromIssueKey": "TEST-1", "toIssueKey": "TEST-2" }' http://localhost:8080/rest/api/2.0.alpha1/issueLink
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you post the curl commands?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
curl -b cookie-jar -H "Content-Type: application/json" -d '{ "linkType": "Duplicate", "fromIssueKey": "TEST-1", "toIssueKey": "TEST-2" }' https://company-name.atlassian.net/api/2.0.alpha1/issueLink
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.