Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,581
Community Members
 
Community Events
184
Community Groups

This is my python script to create jira ticket, but i am getting an error

arunkumarnalladi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Apr 05, 2023
import xml.etree.ElementTree as ET
import requests
import getpass

# Jira authentication
jira_username = ""
jira_api_key = getpass.getpass("E")
jira_project_key = ""

# Parse XML report
tree = ET.parse('/home/mahiratechnology/Videos/Mccain-Jira/report.xml')
root = tree.getroot()

# Loop through the XML elements and create a Jira issue for each one
for element in root:
# Get the summary and description for the issue from the XML element
summary = element.find('summary').text
description = element.find('description').text
# Create the Jira issue payload
issue_data = {
"fields": {
"project": {"key": jira_project_key},
"summary": summary,
"description": description,
"issuetype": {"name": "Task"}, # Set the issue type to Task
"assignee": {"name": jira_username}
}
}
# Send the request to create the Jira issue
response = requests.post(jira_api_url, json=issue_data, auth=(jira_username, jira_api_key))
# Print the response to the console
print(response.json())
my error : {'errorMessages': ['You do not have permission to create issues in this project.'], 'errors': {}}

1 answer

0 votes
Naveen Kumar
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.
Apr 05, 2023

Hi @arunkumarnalladi

Here is the REST API to create the issue https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post

Also, check your create permissions in that project?

Suggest an answer

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

Atlassian Community Events