4
votes

I want to get work log of a specified issue on Jira. According to this document https://docs.atlassian.com/jira/REST/latest/#d2e774 I'm using this format giving my issue id:

/rest/api/2/issue/{issueIdOrKey}/worklog

Although I have logged in Jira, I got this error:

{"errorMessages":["You do not have the permission to see the specified issue.","Login Required"],"errors":{}}

Besides, I can see work log on Jira's interface. I don't think there is an permission constraint. Any help to solve?

2
For newbie developers, I use /rest/auth/1/session and send my username and password using Postman, a Chrome extension. After authentication, you will not get this error again.ismailcem

2 Answers

1
votes

You REST API request need to be authenticated. Please read Authentication paragraph (4th from the top): https://docs.atlassian.com/jira/REST/latest/

The easiest way is to use /rest/auth/1/session: https://docs.atlassian.com/jira/REST/latest/#d2e3737

1
votes

I hit this issue when trying to use Cookie-Based authentication, I was following this guide from Atalassian; https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-cookie-based-authentication

The guide mentions the need for JSESSIONID but does not mention you'll also need to supply studio.crowd.tokenkey, really check what cookie elements you get back when you authenticate in case they change it again, and don't update documentation.

For my own sake I noted down all the code here.