Forums

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

I can't create an issue through Jira Rest API in Python

Test_Jira December 8, 2022

Good afternoon. I use the Jira and Python client, Telegram, I register through the project administrator. I specify a task, an executor, a priority, and when I click "create a task", I get an error in the console.

Why is this happening? After all, I am an administrator, and I can log in through the browser and create a task manually. Please help me.

 

{"errorMessages":["You do not have permission to create issues in this project."],"errors":{}}

2 answers

0 votes
Test_Jira December 8, 2022

Безымянный.png

0 votes
Nic Brough -Adaptavist-
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.
December 8, 2022

Welcome to the Atlassian Community!

This is exactly what it says it is - the account you are using for the connection does not have "create issue" permission in the project you are trying to create the issue in.

There's two possibilities in your case usually - first that you are logging in as someone who has admin rights, but still does not have create issue in the project (admin rights means admin, not "can do anything"), and second that while you think you're logging in with one user on your device, you're actually not.

Test_Jira December 8, 2022

I log in through the administrator, enter the email and the APIkey token. In the settings you can see that the token is used during registration. I'm in the same way, I go through this user through the browser, and I normally create a task, without problems.

Nic Brough -Adaptavist-
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.
December 8, 2022

I'm afraid there's not a lot we can help you with.  The message you are getting is clear that you are logging in with an account that does not have "create issue" in that project.

Can you do other things with the REST API from this application?  A good test would be to edit or comment on an issue and then go look at the issue in the UI, see what account actually made the change.

Test_Jira December 8, 2022

I can do this through the browser, under the user through which I log in. Create, delete, change status, edit. But I can not create a task through the script. I also created a new user, gave him all the rights, added a token. But he also cannot do anything through the script. If it helps, I can send part of the code

Nic Brough -Adaptavist-
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.
December 8, 2022

I'm not sure seeing the code would help, what we really need to see is that the user you are using to log in is the one you think it is.

Even if you set up a simple dummy project (to be thrown away later) with basic rights for everyone to create, and see what your script is passing in as the user, I suspect you are going to find it's not the user you think it is.

Test_Jira December 8, 2022

OK. How to solve the problem in this case? We pulled out all the project IDs, entered them into the issuetype.
Example: issuetype ID " ". And in the end, for all projects, he writes that there are no rights

Nic Brough -Adaptavist-
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.
December 8, 2022

You need to test which user your REST call is actually using to get into Jira.  We can't get any further with this until we can show which user Jira is accepting the login for.

Test_Jira December 8, 2022

It uses the user I'm logged in as. If I use another user, they will not let me go further, it will give an error. I have only 2 users on the project, and I logged in through them. Also, the API token is public, that I go through it

Nic Brough -Adaptavist-
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.
December 8, 2022

Can you show us that your user can make changes somewhere else and be logged as the right one?

What does a "public" token mean?  Who does it identify?

Test_Jira December 8, 2022

I mean the API token that grants access to the products. It's in the settings.

Test_Jira December 8, 2022

I can't upload an image here

Nic Brough -Adaptavist-
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.
December 9, 2022

Ok, but can you show us that your user can make changes somewhere else and be logged as the right one?  When using the API?

Juan Jimenez April 11, 2025

I am having exactly the same problem as described by Test_Jira.  I have create a Personal Access Token for the very account I am able to create issue types in JIRA through the browser.

This simple command should work:

curl -v -D- -H "Authorization: <pat removed for obvious reasons>" \

     -H "Content-Type: application/json" \

     --request POST \

     --data '{"fields": {"project": { "key": "CIP"},"summary": "curl","description": "curl script","issuetype" : {"name": "Task"}}}'  https://<company_name>.atlassian.net/rest/api/3/issue

But it does not with the error:

{"errorMessages":["You do not have permission to create issues in this project."],"errors":{}}

Some AI LLM tool suggested this:

Verify PAT Permissions:

Go to your Atlassian account settings

Navigate to Security > Personal access tokens

Check that your token has the necessary permissions (read:jira-work, write:jira-work)

Consider creating a new token with explicit permissions for issue creation

But I do not see those options on my JIRA installation.  I can only create tokens with an expiry date.  Nothing else.

This is the JIRA I am using:

Build Number: 100283
Build Date: 2025-04-10T17:15:24.000+0200
Deployment Type: Cloud

If you still think we are doing something wrong, can you suggest some different way of debugging this that is different than what I have tried already?

Thank you!

 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events