Forums

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

Permissions API Issue: {"errorMessages":["You do not have permission to create issues in this projec

Gamers-Israel Community November 24, 2023

Hello team, i code this code:

#!/usr/bin/env python3

import sys
import json
import requests
from requests.auth import HTTPBasicAuth

# Read configuration parameters
alert_file = open(sys.argv[1])
user = sys.argv[2].split(':')[0]
print(user)
api_key = sys.argv[2].split(':')[1]
hook_url = sys.argv[3]

# Read the alert file
alert_json = json.loads(alert_file.read())
alert_file.close()

# Extract issue fields
alert_level = alert_json['rule']['level']
ruleid = alert_json['rule']['id']
description = alert_json['rule']['description']
agentid = alert_json['agent']['id']
agentname = alert_json['agent']['name']

# Set the project attributes ===> This section needs to be manually configured before running!
project_key = 'WT' # You can get this from the beggining of an issue key. For example, WS for issue key WS-5018
issuetypeid = '10002' # Check https://confluence.atlassian.com/jirakb/finding-the-id-for-issue-types-646186508.html. There's also an API endpoint to get it.

# Generate request
headers = {'content-type': 'application/json'}
issue_data = {
"update": {},
"fields": {
"summary": 'Wazuh Alert: ' + description,
"issuetype": {
"id": issuetypeid
},
"project": {
"key": project_key
},
"description": {
'version': 1,
'type': 'doc',
'content': [
{
"type": "paragraph",
"content": [
{
"text": '- Rule ID: ' + str(ruleid) + '\n- Alert level: ' + str(alert_level) + '\n- Agent: ' + str(agentid) + ' ' + agentname,
"type": "text"
}
]
}
],
},
}
}

# Send the request
response = requests.post(hook_url, data=json.dumps(issue_data), headers=headers, auth=(user, api_key))
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))) # <--- Uncomment this line for debugging

sys.exit(0)


While i am trying to run this code i got this errors:
{
"errorMessages": [
"You do not have permission to create issues in this project."
],
"errors": {}
}

I am the project lead and jira owner, how can i fix this issue ?

4 answers

0 votes
Juan Jimenez April 11, 2025

I am having exactly the same problem as described above.  I have created 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!

0 votes
Gamers-Israel Community November 25, 2023

Any news?

0 votes
Gamers-Israel Community November 24, 2023

Update:
While i am changing the Create Issues permissions like this guide:
Allow anonymous access to projects | Atlassian Support
To be public then the issues created by Anonymous reporter and i want to make the reporter user to be what i insert in the code and not to make it public,
also if public is enabled then everybody can create for me issues if they have the link.

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