Page 1 of 1

[Soap_api] mc_issue_add custom fields problem

Posted: 12 Jan 2018, 04:15
by tuanklnew
Hello everyone, I am working on MantisBT client by using Zeep of Python 3 that connect to Soap api of Mantis. On Mantis 2.8, my program call mc_issue_add with no error. Unfortunally, When I upgrade to Mantis 2.10 my program does not work anymore but show error:

Code: Select all

zeep.exceptions.Fault: Cannot use object of type stdClass as array
I used:

Code: Select all

zeep_client.get_type('ns0:IssueData')
to get structure and then put value in it so I think is impossible that something is wrong with my structure.
There is an example of my structure:

Code: Select all

{
    'id': None,
    'view_state': {
        'id': '50',
        'name': 'private'
    },
    'last_updated': datetime.datetime(2018, 1, 12, 8, 55, 16, 404946),
    'project': {
        'id': '1',
        'name': 'test_mantis'
    },
    'category': 'General',
    'priority': {
        'id': '20',
        'name': 'low'
    },
    'severity': {
        'id': '40',
        'name': 'tweak'
    },
    'status': {
        'id': '10',
        'name': 'new'
    },
    'reporter': {
        'id': '1',
        'name': 'administrator',
        'real_name': 'Nguyen Tri Tuan',
        'email': 'root@localhost'
    },
    'summary': 'This is summary for testing',
    'version': None,
    'build': None,
    'platform': None,
    'os': None,
    'os_build': None,
    'reproducibility': None,
    'date_submitted': None,
    'sponsorship_total': None,
    'handler': None,
    'projection': None,
    'eta': None,
    'resolution': None,
    'fixed_in_version': None,
    'target_version': None,
    'description': 'This is description for testing 1',
    'steps_to_reproduce': None,
    'additional_information': 'This is addition information for testing 1',
    'attachments': None,
    'relationships': None,
    'notes': None,
    'custom_fields': [
        {
            'field': {
                'id': '2',
                'name': 'IP Address'
            },
            'value': '192.168.172.9'
        }
    ],
    'due_date': None,
    'monitors': None,
    'sticky': 'false',
    'tags': None
}
I also find out that when I clear my custom fields it will work normally.

Re: [Soap_api] mc_issue_add custom fields problem

Posted: 12 Jan 2018, 08:04
by atrol
Please create a bug report for it https://www.mantisbt.org/bugs

Re: [Soap_api] mc_issue_add custom fields problem

Posted: 12 Jan 2018, 10:53
by tuanklnew
atrol wrote:Please create a bug report for it https://www.mantisbt.org/bugs
I reported bug. But it seems this bug existed from Mantis BT 2.9.0 and my report is duplicated. Unfortunately this bug is still not fixed.

Re: [Soap_api] mc_issue_add custom fields problem

Posted: 13 Jan 2018, 09:48
by atrol
It would be good if you could check if this fixes the issue https://github.com/mantisbt/mantisbt/pull/1268/files

Re: [Soap_api] mc_issue_add custom fields problem

Posted: 13 Jan 2018, 09:58
by atrol