Page 1 of 1

Creating a workitem with assignees

Posted: Wed Jan 24, 2018 1:42 pm
by stoejs
Hi,
setup: Polarion® ALM™ 17, python3, zeep (SOAP-Client) on Windows

I'm trying to create a work item and add an assignee to it using createWorkItem on the tracker webservice. However, when I add an assignee to my function call, I get the response

Code: Select all

Workflow initialization failed for Work Item 'FEHW-157': The required field 'assignee' of Work Item 'FEHW-157' is empty.


When I create the work item without an assignee (normally prohibited) and add the assignee afterwards with addAssignee, everything is fine.

createWorkItem gets an object of type ArrayOfUsers consisting of Users and if I print a similar workitem, I can see no differences.
This is part of a workitem Polarion recoginizes as empty:

Code: Select all

    'assignee': {
        'User': [
            {
                'description': None,
                'disabledNotifications': False,
                'email': 'asdf@asdf.de',
                'homePageContent': None,
                'id': 'StoeJs',
                'name': 'asdf',
                'voteURIs': None,
                'watcheURIs': None,
                'uri': 'subterra:data-service:objects:/default/${User}StoeJs',
                'unresolvable': False
            }
        ]
    },


Do you know what could be done? Do you need any code?

Re: Creating a workitem with assignees

Posted: Thu Jan 25, 2018 9:29 am
by soukupm
It is a problem - the assignee is not set in TrackerWebService.createWorkItem.
You can do it in one transaction of four steps:
SessionWebService.beginTransaction
TrackerWebService.createWorkItem
TrackerWebService.addAssignee
SessionWebService.endTransaction(false)

Milos

Re: Creating a workitem with assignees

Posted: Thu Jan 25, 2018 10:48 am
by stoejs
soukupm wrote:It is a problem - the assignee is not set in TrackerWebService.createWorkItem.


Okay, I see. What does the assignee parameter do then?

Re: Creating a workitem with assignees

Posted: Thu Jan 25, 2018 11:17 am
by soukupm
In the TrackerService.createWorkItem method you define the content of your future work item. If it contains the assignee element, it is ignored. It is a bug.

Re: Creating a workitem with assignees

Posted: Thu Jan 25, 2018 11:41 am
by stoejs
Okay. I already use the workaround you provided - without the transaction part though.
Thanks for the clarification!

Re: Creating a workitem with assignees

Posted: Mon Jul 30, 2018 10:38 am
by stoejs
For future reference:
In order for this to work, you'll have to enable the option to create workitems without specifying an assignee in Polarion backend.