Forums

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

Can we create a change request using python script with a free jira account

Rahul Kumar Mishra
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!
October 19, 2023
import requests
import json
from jira import JIRA
from jira.client import JIRA

# Jira server and credentials
user = 'xxx'
password = 'xxx'



issue_dict = {
        'project': {'key': 'CHAN'},
        'summary': 'Need Approval for request' ,
        'description' : 'description_str',
        'issuetype': {'name': '[System] Change'}
        }
options={'server': jira_server}        
auth_jira = JIRA(options ,basic_auth=(user , password))
new_issue = auth_jira.create_issue(fields= issue_dict)              


print("ooooooooooooooo" , new_issue)



error I am getting is:

raise JIRAError(
jira.exceptions.JIRAError: JiraError HTTP 401 url: https://topop.atlassian.net/rest/api/2/issue
text: You do not have permission to create issues in this project.

response headers = {'Date': 'Thu, 19 Oct 2023 07:34:27 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Server': 'AtlassianEdge', 'Timing-Allow-Origin': '*', 'X-Arequestid': 'f810258e9763ec1338b0ff493dd32c52', 'X-Seraph-Loginreason': 'AUTHENTICATED_FAILED', 'Cache-Control': 'no-cache, no-store, no-transform', 'Www-Authenticate': 'OAuth realm="https%3A%2F%2Ftopop.atlassian.net"', 'X-Content-Type-Options': 'nosniff', 'X-Xss-Protection': '1; mode=block', 'Atl-Traceid': '8a41ea636c5ebb9c', 'Report-To': '{"endpoints": [{"url":
"https://dz8aopenkvv6s.cloudfront.net"}], "group": "endpoint-1", "include_subdomains": true, "max_age": 600}', 'Nel': '{"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to": "endpoint-1"}', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload', 'Transfer-Encoding': 'chunked'}
response text = {"errorMessages":["You do not have permission to create issues in this project."],"errors":{}}



0 answers

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