Hi,
I actually want to access the comments of all the tickets that I filtered based on a JQL query. I exported the tickets to an excel sheet, but the comments don’t get exported. So I tried to do it programmatically using Python and the JIRA rest API but its failing with 401 at the authentication level itself. I used username and API token. I am wondering if its because I do not have admin rights on my user and also, I use 2 factor authentication to login to my company’s Kazan JIRA portal. This is the authentication code part which is failing
I would appreciate any help in this direction. If there is any other way through which I can extract comments and worklog for the tickets, then I would appreciate that too. Thanks a lot.
Hello Sudha,
maybe this few steps will help you resolve your issue:
Use OAuth 2.0 Authentication: Since you’re using 2FA, basic authentication might not work. Instead, consider using OAuth 2.0 for authentication2. This method is more secure and better suited for applications requiring higher security.
Generate an Access Token: You’ll need to generate an access token using OAuth 2.0. Here’s a basic example of how to do this:
Check Permissions: Ensure that your user account has the necessary permissions to access the comments and worklogs. If you don’t have admin rights, you might need to request the appropriate permissions from your Jira administrator.
Extract Comments and Worklogs: Once authenticated, you can use the REST API to extract comments and worklogs. Here’s an example of how to get comments for a specific issue: