1
votes

i'm getting the following error every time that i try to send an issue to Jira:

suds.WebFault: Server raised fault: 'org.xml.sax.SAXException: 
   Found character data inside an array element while deserializing'

I search on stackoverflow and the web for the answer and some people say that is suds 0.3 < fault. But i'm using the 0.4.1.1 version.

Here is my issue dict:

  issue = {"assignee": "user_test",
             "components": "17311",
             "project": "TES",
             "description" : "This is a test",
             "priority" : "Major",
             "summary" : "Just a test title",
             "type":"Incident"
             }

Class Jira made by me:

  def create_issue(self,issue):
        if(not isinstance(issue,dict)):
            raise Exception("Issue must be a dict")

        new_issue = self.jira.service.createIssue(in0 = self.auth,in1 = issue)

        return new_issue["key"]
2
Shouldn't issue be an issue object rather than a dict? self.jira.factory.create('Issue') - jordanm

2 Answers

1
votes

Using jira-python I was able to add components with like:

jira.create_issue(project={'key': project_id}, summary=ticket_summary,
                                 description=ticket_description, issuetype={'name': ticket_issue_type},
                                 components=[{'name': 'Application Slow'},], parent={'id': new_issue_key}, customfield_10101=termination_change_date,
                                 )

I kept trying to send a component as "components={'name': 'Application Slow'}", but I was getting a "data was not an array" (or something similar). I took a look at the REST API and how some of their array examples were composed which is how I came to my example above.

https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue#JIRARESTAPIExample-CreateIssue-Request

Labels
"customfield_10006": ["examplelabelnumber1", "examplelabelnumber2"]
Labels are arrays of strings

I know this is a bit off topic, but when I searched for my issue I found myself coming back here often so I hope this is a bit helpful for your case and to anyone else. The concept is the same as the components field will only accept an array of objects.

0
votes

components is not right. It has to be an array of things because it is multivalued. Some hints at https://developer.atlassian.com/display/JIRADEV/Creating+a+JIRA+SOAP+Client or look at how the JIRA Python CLI does it

'components': [17311]