Forums

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

Challenges when creating issue with Python script "can not deserialize instance of com.atlassian

Praveen Chitturi
Contributor
February 12, 2022

Dear Community,

 

I'm looking to create the issue from Python script with the below coding. Our's JIRA is on AWS. 

Then script is returning the error message as below.  Does any one experienced access JIRA from Python script? 

{"errorMessages":["Can not deserialize instance of com.atlassian.jira.rest.v2.issue.IssueUpdateBean out of START_ARRAY token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@7edec606; line: 1, column: 1]"]}

The coding is here.

#
# Script to create the JIRA Story based on the Issue Key
#

import requests
import json
from wsgiref import headers
from pip._internal.network import auth
import JIRAonAWSRestAPI

def main():
url="https://jira.companyname.com/rest/api/2/issue"
username="ouruser"
password="ourpassword"

myheaders= {'Content-type':"application/json" , 'Accept':"application/json"}

payload=[
{
"fields": {
"summary": "TEST JIRA Issue in for JIRA on AWS ",
"issuetype": {
"id": "10001"
},
"project": {
"key": "ITD"
},
"assignee": {
"name": "ourusername"
},
"components": [
{
"name": "SALES"
}
],
"customfield_10302": "2021-07-28",
"customfield_10301": 16 ,
"customfield_10303": {
"id": "10666"
}
}
}
]

response = requests.post(url, data=json.dumps(payload), headers= myheaders, auth=(username, password))

print(response.text)


if(__name__ == "__main__"):
main()

 

 

 Regards,

Praveen

1 answer

1 accepted

2 votes
Answer accepted
Praveen Chitturi
Contributor
February 12, 2022

Hi,

I got the correct info from the existing question in the community that the standalone documentation alone from atlassian for python script 

https://atlassian-python-api.readthedocs.io/index.html . I will refer that. 

 

Regards,

Praveen

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events