Question

I can't figure how to create a jira issue and define its component with SOAPpy:

client = so.WSDL.Proxy(cfg_wsld)
auth_token = client.login(cfg_username, cfg_password)
issue_params = dict()
issue_params['project'] = project
issue_params['type'] = issue_type
issue_params['summary'] = summary
issue_params['description'] = summary
newissue = client.createIssue(auth_token, issue_params)

This sample works fine but I try to add components to it Jira will return missmatchTypeException.

I've tried all kinds of variants: passing arrays, strings, ints into it but it won't pick any of them up.

Most attempts (passing string, int, array of both) will cause TypeMissmatch, this causes NullPointerException inside Jira:

issue_params['components'] = {u'Разное': {'id': '11143', 'name': u'Разное'}}

I know the exact id of the issue type I want to use but how do I pass it properly? When I retrieve an issue with this type components returns as SOAPpy.Types.typedArrayType() but this still fails:

issue_params['components'] = so.Types.typedArrayType(data={'id': '11143', 'name': u'Разное'})
newissue = client.createIssue(auth_token, issue_params)

(<class 'SOAPpy.Errors.Error'>, <Error : Data must be a sequence>, None)
Was it helpful?

Solution

issue_params['components'] = so.Types.typedArrayType(data=[{'id': '11143', 'name': u'Разное'},])

This did the trick - data needs to be an array.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top