Problem querying work item
Hi, I've a really strange error on a query into a java class developed using plain java API.
The same code, used on a server side plugin, works correctly. The only difference is the use of client side class instead of services. The snippet I've used is:
Other strange thing is that if I use an expression on projectArea instead of state and than cycle with the results I get that the identifier of state of the desidered workitem is equal to What I'm doing wrong on selecting this state? Thanks on advance for any help. |
5 answers
Hi, I've a really strange error on a query into a java class developed I can only see the snippet (which basically looks ok to me), but no error message or stack trace. Is the error you encounter the one you describe below? Or was there an exception? Other strange thing is that if I use an expression on projectArea I don't quite understand; are you seeing a mismatch in state identifiers? Like '3' vs. 's3'? Could you describe what you expected and what you got with a little example? -- Regards, Patrick Jazz Work Item Team |
Thank you for the answer. I don't have any exception, simply if I put on term the constraint on the state I don't have any results as I aspect to see some results. If I take of the constraint, I see all the items and than, if I catch the ones which I know to be in correct state, I compare the IWorkItem.getState2() with my selectedState variable using equals method and it returns true. Also if I debug the code I can see that state identifiers are exactly the same.
So I was asking myself why, if they are equals, the term with "selectedState" does not run. As I said this behaviour seems to occors only using client side class, because on server side it runs. And so I was thinking that I'm using these class incorrectly. |
Hi,
I'm still asking myself if I'm doing something wrong. I use this code: Identifier<IState> eme_id_state = Identifier.create(IState.class, RU_EME_STATE); and it returns zero work-item. If I use NOT_EQUALS I get the items and then if I try a comparation of getState2 method on these items I exactly have eme_id_state. So it seems quite stupid use an empty query and then cycling all results... Any suggestions? Thanks, Michele. |
Hi, I don't know the answer, but what data types does AttributeOperation.EQUALS support comparison of? boolean, string, integer? what is your attribute data type? not-equals would probably work for mismatched data types.. Sam |
Hi Sam,
thanks for your reply. I'm using IWorkItem.STATE_PROPERTY and the Javadoc says that I obtain this property using getState2 methods. This methods returns to me an Identifier<IState> so I've put on AttributeExpression an object of this type. The strange thing is that if I use NOT_EQUALS and then cycle the workitems returned selecting only the workitems in the state I'm searching about, if I use getState2 methods I obtain exactly what I have created on eme_id_state. To be clear: returnedWi.getState2().equals(eme_id_state) returns true! Michele. |
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.