cancel
Showing results for 
Search instead for 
Did you mean: 

Task List Api (POST api/enterprise/tasks/query) always returning same result even Assignmnet details has changed in request.

visingh
Champ on-the-rise
Champ on-the-rise
Hi,

I am facing one issue with Task List rest api (POST api/enterprise/tasks/query). I am providing below request body in Mozila rest client

{"assignment":{"assignee":"69000"}}

But i am getting the list of task which are assigned to some other users. One of the task I am showing here. Below task is assigned to user with assignee id 77001 but I have given 69000 in request body. Even I change the assignee to some other assignee id but result is still the same. Can somebody help me here and provide exact Request Body JSON if I am sending wrong JSON in request body.

"id": "101185",
            "name": "DemoTest",
            "description": "Test Task Demo",
            "category": null,
            "assignee":
            {
                "id": 77001,
                "firstName": "Bharat Singh",
                "lastName": "Rathore",
                "email": "brathore@inautix.co.in",
                "externalId": "XBBKNTM"
            },
            "created": "2015-09-11T06:53:20.143+0000",
            "dueDate": null,
            "endDate": null,
            "duration": null,
            "priority": 50,
            "parentTaskId": null,
            "parentTaskName": null,
            "processInstanceId": null,
            "processInstanceName": null,
            "processDefinitionId": null,
            "processDefinitionName": null,
            "processDefinitionDescription": null,
            "processDefinitionKey": null,
            "processDefinitionCategory": null,
            "processDefinitionVersion": 0,
            "processDefinitionDeploymentId": null,
            "formKey": null,
            "processInstanceStartUserId": null,
            "initiatorCanCompleteTask": false,
            "adhocTaskCanBeReassigned": false,
            "memberOfCandidateGroup": false,
            "memberOfCandidateUsers": false
        }

7 REPLIES 7

visingh
Champ on-the-rise
Champ on-the-rise
Anybody has clue on this?

vasile_dirla
Star Contributor
Star Contributor
Hi,
according to this documentation: http://docs.alfresco.com/activiti/topics/bpm-task_list.html
you should pass as assignment one of these values: assignee, candidate… and then the query is done by verifiying if the curent user is in relation to the task based on the assignment type you provided:
for example: if you provide: "assignee" then will filter the tasks where the current user is assignee.

Thanks for your response. I am trying the same. I am passing this JSON {"assignment":{"assignee":"XXXXX"}} in request body and I am getting the tasks which are assigned to user YYYYY.

Can you please provide me the exact request body as this is not given in document.

trademak
Star Contributor
Star Contributor
Hi,

Which version of the Activiti BPM Suite are you using?

Best regards,

visingh
Champ on-the-rise
Champ on-the-rise
1.3.3

vasile_dirla
Star Contributor
Star Contributor
<code>
{"assignment":{"assignee":"XXXXX"}}
</code>
is not going to work because the "assignment" node is expected to be a text node not JSON.
so:
<code>
"assignment":"assignee"
</code>
is the node you need.

and the check is done against the current user.
will return tasks where the current user is assigned.

visingh
Champ on-the-rise
Champ on-the-rise
Thanks a lot. I understood.