JIRA REST API to get work log - “You do not have the permission to see the specified issue”

自闭症网瘾萝莉.ら 提交于 2019-12-10 15:42:34

问题


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?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/28434628/jira-rest-api-to-get-work-log-you-do-not-have-the-permission-to-see-the-speci

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!