Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Access problem to the REST API

LaBulle22
Contributor
March 24, 2025

Hello,

I use the Python module Jira (https://pypi.org/project/jira/) to write Python scripts in command-line mode (token-based authentication). I have noticed that in some cases, these scripts do not work because Jira commands sent to the server are denied. However, if I connect to the Jira server using my web browser, the scripts start working. This suggests a link between the Jira module and the browser, or possibly the browser cache.

Have you encountered this issue? If so, do you know of a solution?

3 answers

1 vote
Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2025

Hello @LaBulle22 

Don't trust the old PyPi library, it's know to have a range of little problems.

You are much better off using Python's native requests library (http://docs.python-requests.org) and interact directly with the API endpoints. Yes, it takes more effort to build your requests, but the end result is a more 'pure' result and you break the dependency on a third party library to 'shortcut' your work.

Supplement your coding with an API test tool like Postman to confirm whether a problem is due making a mistake with the request versus a coding mistake.

Have fun.

0 votes
LaBulle22
Contributor
March 24, 2025

Hi @Vishal Biyani @Sunny Ape

I conducted the investigation in my company as well. It finally appears that we are using this feature (User Management - License & User Deactivator for Jira | Atlassian Marketplace) and it is this feature that is the cause of my problem.

All Jira user accounts are impacted, in reality our configuration is such that you need a functional Jira account to avoid the obligation to log in to the browser before launching your script (functional accounts have a permanent licence).

Thanks again to have spent some time to help me.

0 votes
Vishal Biyani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2025

@LaBulle22 

I am using this library with python code without any issues. 

Can you share what error you are getting (for jira command denied)?

Suggest an answer

Log in or Sign up to answer