Creating a workitem with assignees

Description
stoejs
Posts: 5
Joined: Wed Jan 24, 2018 12:05 pm

Creating a workitem with assignees

Postby stoejs » Wed Jan 24, 2018 1:42 pm

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?

soukupm
Posts: 8
Joined: Tue Mar 26, 2013 3:32 pm

Re: Creating a workitem with assignees

Postby soukupm » Thu Jan 25, 2018 9:29 am

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

stoejs
Posts: 5
Joined: Wed Jan 24, 2018 12:05 pm

Re: Creating a workitem with assignees

Postby stoejs » Thu Jan 25, 2018 10:48 am

soukupm wrote:It is a problem - the assignee is not set in TrackerWebService.createWorkItem.


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

soukupm
Posts: 8
Joined: Tue Mar 26, 2013 3:32 pm

Re: Creating a workitem with assignees

Postby soukupm » Thu Jan 25, 2018 11:17 am

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.

stoejs
Posts: 5
Joined: Wed Jan 24, 2018 12:05 pm

Re: Creating a workitem with assignees

Postby stoejs » Thu Jan 25, 2018 11:41 am

Okay. I already use the workaround you provided - without the transaction part though.
Thanks for the clarification!

stoejs
Posts: 5
Joined: Wed Jan 24, 2018 12:05 pm

Re: Creating a workitem with assignees

Postby stoejs » Mon Jul 30, 2018 10:38 am

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.


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 9 guests