It's all about the answers!

Ask a question

Get List of Deliverables


Saurav Pratik (284) | asked Dec 06 '17, 6:17 p.m.

I am looking to setValue for FoundIn attribute. I can get a value for one particular WorkItem and hence fetch IDeliverable handler for that and update the value.


My question is how can I get the list of all deliverables and then I can compare and select one for setting the value.

Accepted answer


permanent link
Ralph Schoon (63.6k33646) | answered Dec 07 '17, 4:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

It is really easy to search the SDK, so it makes sense to set it up even if you only develop client APi.
I just searched for findDeliverable and voila:

com.ibm.team.workitem.common.IWorkItemCommon.findDeliverableByName(IProjectAreaHandle, String, ItemProfile<IDeliverable>, IProgressMonitor)

com.ibm.team.workitem.common.IWorkItemCommon.findDeliverablesByArtifact(IItemHandle, ItemProfile<IDeliverable>, IProgressMonitor)

com.ibm.team.workitem.common.IWorkItemCommon.findDeliverablesByProjectArea(IProjectAreaHandle, boolean, ItemProfile<IDeliverable>, IProgressMonitor)

Saurav Pratik selected this answer as the correct answer

Comments
Saurav Pratik commented Dec 07 '17, 11:23 a.m.

 Thanks a lot for the answer. 

One other answer



permanent link
Saurav Pratik (284) | answered Dec 06 '17, 6:54 p.m.

 I am also adding some code for reference


<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px} span.s1 {font-kerning: none} </style>

String idString = "755902";

int id = new Integer(idString).intValue(); 


        IWorkItem workItemDummy = workItemClient.findWorkItemById(id, 

                IWorkItem.SMALL_PROFILE, null); 

        IAttribute foundIn = workItemClient.findAttribute((IProjectAreaHandle)projectArea, 

                IWorkItem.FOUND_IN_PROPERTY, null); 

        if (workItem.hasAttribute(foundIn)){ 

            IDeliverableHandle foundInValueHandle = (IDeliverableHandle) workItemDummy.getValue(foundIn); 

            

            IDeliverable foundInValue = (IDeliverable)teamRepository.itemManager().fetchCompleteItem(foundInValueHandle, IItemManager.REFRESH, null); 

           

            System.out.println("Found In "+ foundInValue.getName() ); 

            

            

           

This code gives me the IDeliverable value for an existing work item. But I need to get the complete list available so that I can set one of them as SetValue for foundIn attribute

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.