It's all about the answers!

Ask a question

Difference between fetchCompleteItem and fetchCompleteState methods of ItemManager class ?


Nilesh Patil (1733650) | asked Nov 29 '12, 4:44 a.m.

I am getting permission denied exception when I tried to fetch complete state by passing workitem handle using fetchCompleteState where as fetchCompleteItem is returning workitem with out giving any error.

My implementation is like first I will get all states(History) of workitem by using fetchAllStateHandles method of ItemManager class. Then I will iterate over the list I got from fetchAllStateHandles and get the complete workitem of each handle. It was working fine with JAZZ server 3.X but it is giving error for some workitems in JAZZ server 4.x(this is not the case with all workitems some workitems it is working fine and some it is giving error).

For EX: I have a workitem xxx and when fetch all state handles I am getting 12 state handles among them for 6 states it is fetching the complete state and for remaining states it is illegat read access.

When I use fetchCompleteStateAwareOfPermisson method of ItemManger, it is returning a list. In list it is clearly showing accesdenied for six workitem handle and remaining are present retrieved list.

I have complete access rights. I can normally view the workitem and it's history on the browser and RTC client editor.

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Nov 29 '12, 7:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As far as I can tell fetchCompleteItem() returns the latest state of a work item. If you pass the work item handle to fetchCompleteState() it returns the same.

If you use fetchAllStateHandles() you get all historical and the current state handles, if you fetch the states you get - as far as I can tell - the states of the work item in its history.

If you fetch permission aware you will get the items back where you have permission to read and typically the handles for items that can not be found or you don't have permission to in different sets. If you get permission denied items back you don't have permission, regardless if you have permission to read the current state, I think. 

Comments
Pheneenda gadipoodi commented Nov 30 '12, 12:12 a.m.

Thanks for your quick reply.

But I have complete rights and I can view the workitems with all kinds of restirctions in browser and RTC client. This is the case only when I try to fetch the complete state programmatically.

FYI inforamtion this is the problem I am facing since we upgraded jazz server to 4.x from 3.x. Is it any thing related to server?


Pheneenda gadipoodi commented Nov 30 '12, 5:41 a.m.

Please let me know if you need more information..


Ralph Schoon commented Nov 30 '12, 6:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I can't help you further. The fact that you can see the work item only says that you can fetch the last state. It is simply the same as if you used fetchCompleteItem().

I am not sure why you want to fetch the historical states. But if you do and you don't have access to some of them, you don't have access, whatever the reason for that might be. Reasons might be team permissions you did not have back then. I don't know enough about the internals to answer why that could be the case.


Ralph Schoon commented Nov 30 '12, 6:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you think that it is an issue with the upgrade, I would suggest to open a work item or a PMR. However, I would suggest to use the PermissionAware fetch,because you can't assume you have full access to everything.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.