It's all about the answers!

Ask a question

list all WorkItems of one Project Area


Paulino Alonso (381215) | asked Jul 24 '12, 6:32 a.m.
Hello,

I´m working with a Follow up that extends AbstractService and implements IOperationParticipant ...

I need to list all WorkItems of one Project Area, to get especifics values of atributes for each WI...



With this I list all attributes but not the values....

List<IWorkItemType> listaWIT=workItemServer.findWorkItemTypes(pa, monitor);
Iterator<IWorkItemType> iterW =listaWI2.iterator();
while (iterW.hasNext()){
         List<IAttributeHandle> listaAtt=iterW.next().getCustomAttributes();
         Iterator<IAttributeHandle> iterAtt=listaAtt.iterator();
                        while (iterAtt.hasNext()){
                            IAttribute  attribute= auditableServer.resolveAuditable(
                                         iterAtt.next(),
                                         ItemProfile.<IAttribute>createFullProfile(IAttribute.ITEM_TYPE),
                                         monitor);
                            //attribute.getValue() ------>I need something like that....????
                          }
}

Anyone know any solution???

thanks

Accepted answer


14 other answers



permanent link
Paulino Alonso (381215) | answered Jul 25 '12, 7:51 a.m.
I change this:

 IQueryResult<iresolvedresult<iworkitem>> results=queryClient.getResolvedExpressionResults(targetProjectArea, inProjectArea,IWorkItem.SMALL_PROFILE); ---->IWorkItem.FULL_PROFILE...

Think i have the custom attrs....

permanent link
Ralph Schoon (63.4k33646) | answered Jul 25 '12, 7:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If there are no custom attributes (only built in attributes) your custom attributes list returned will be empty.
Have you added a custom attribute to your work item type?
You can also try IAttribute.FULL_PROFILE for the profile.

permanent link
Ralph Schoon (63.4k33646) | answered Jul 25 '12, 8:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 25 '12, 8:13 a.m.
One last addition. The queries have a limit that is set server side. If you want all, you have to set the limit of the result set to the maximum first, before you do anything with it:
       results.setLimit(Integer.MAX_VALUE);

One last comment. It has already been stated, but you are impacting the UI performance heavily doing this. You should consider if there would be a way to trigger this in the participant and have some sort of background job doing the work later.

permanent link
Paulino Alonso (381215) | answered Jul 30 '12, 6:19 p.m.
Hello Ralph,

now i´m trying get the CHILD_WORK_ITEMS ...(only by AbstractService )

After searching the forum, this should run....

IWorkItemReferences ref= workItemServer.resolveWorkItemReferences((IWorkItemHandle)workItem, monitor);
List<ireference>  listChildReferences = ref.getReferences(WorkItemEndPoints.CHILD_WORK_ITEMS);     //Always listChildReferences.size()=0..???

Can you help me?

I opened another post to this question

https://jazz.net/forum/questions/83259/find-child_work_items-in-a-follow-up-extends-abstractservice-implements-ioperationparticipant

Thanks

permanent link
Paulino Alonso (381215) | answered Jul 30 '12, 6:30 p.m.
(IWorkItemHandle)workItem.getItemHandle()  in ref

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.