The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • Challenges when creating issue with Python script "can not deserialize instance of com.atlassian

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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

TAGS
AUG Leaders

Atlassian Community Events