[closed] Getting Attributes of a Defect work items
Myroslav Palenychka (51●1●7●5)
| asked May 29 '09, 3:42 p.m.
closed Jun 20 '15, 4:17 p.m. by Ralph Schoon (63.3k●3●36●46)
Hello,
I have done some examples with work items and I cannot find how I can retrieve fields like Filed Against and Planned for attributes of a work item. I was looking in methods of IWorkItem and there is no method get PlannedFor. What should I do and which class should I use for that? Regards, Myroslav |
The question has been closed for the following reason: "The question is answered, right answer was accepted" by rschoon Jun 20 '15, 4:17 p.m.
13 answers
I have done some examples with work items and I cannot find how I can The methods are IWorkItem#getValue(IAttribute attribute) and IWorkItem#setValue(IAttribute attribute, Object value) In order to get the IAttribute, you would use: IWorkItemClient client= repository.getClientLibrary(IWorkItemClient.class); IAttribute filedAgainst= client.findAttribute(projectArea, IWorkItem.CATEGORY_PROPERTY, monitor); -- Regards, Patrick Jazz Work Item Team |
I was able to get attributes with IAttribute class however all I need is to display it as a String, say found in: "1.1.1". When I output IAttribute I get:
Found in: com.ibm.team.workitem.common.internal.model.impl.DeliverableHandleImpl@1c771c77 (stateId: <unset>, itemId: , origin: com.ibm.team.repository.client.internal.TeamRepository@69526952, immutable: true) Thanks, Myroslav I have done some examples with work items and I cannot find how I can The methods are IWorkItem#getValue(IAttribute attribute) and IWorkItem#setValue(IAttribute attribute, Object value) In order to get the IAttribute, you would use: IWorkItemClient client= repository.getClientLibrary(IWorkItemClient.class); IAttribute filedAgainst= client.findAttribute(projectArea, IWorkItem.CATEGORY_PROPERTY, monitor); -- Regards, Patrick Jazz Work Item Team |
I was able to get attributes with IAttribute class however all I need You will have to resolve the resulting deliverable: IDeliverableHandle handle= (IDeliverableHandle) workItem.getValue(foundInAttribute); IDeliverable deliverable= auditableClient.resolveAuditable(handle, IDeliverable.SMALL_PROFILE, monitor); display(deliverable.getName()); -- Regards, Patrick Jazz Work Item Team |
Thanks for your replay Patrik. I was able to get and display Found In attribute as there is attribute IWorkItem.FOUND_IN_PROPERTY. However for Planned for and Filed against I still have a problem. In the class IWorkIteam I cannot find PLANNED_FOR_PROPERTY String attribute. I don't think it is there. How I can display Planned for and Filed against properties of a work item?
Thanks, Myroslav I was able to get attributes with IAttribute class however all I need You will have to resolve the resulting deliverable: IDeliverableHandle handle= (IDeliverableHandle) workItem.getValue(foundInAttribute); IDeliverable deliverable= auditableClient.resolveAuditable(handle, IDeliverable.SMALL_PROFILE, monitor); display(deliverable.getName()); -- Regards, Patrick Jazz Work Item Team |
Thanks for your replay Patrik. I was able to get and display Found In There were terminology changes over time, so the properties you are looking for are: Filed Against: IWorkItem.CATEGORY_PROPERTY Planned For: IWorkItem.TARGET_PROPERTY -- Regards, Patrick Jazz Work Item Team |
Thanks, I was able to successfully get the Category with using ICategoryHandle and ICategory classes. I still have problems with TARGET_PROPERTY.
IIterationHandle iterHandle = (IIterationHandle)item.getValue(plannedFor); Iteration iter = auditableClient.resolveAuditable(iterHandle,IIteration.SMALL_PROFILE, monitor); But there is no attriubute IIteration.SMALL_PROFILE in class IIteration. Am I doing something wrong? Thanks, Myroslav Thanks for your replay Patrik. I was able to get There were terminology changes over time, so the properties you are looking for are: Filed Against: IWorkItem.CATEGORY_PROPERTY Planned For: IWorkItem.TARGET_PROPERTY -- Regards, Patrick Jazz Work Item Team |
Myroslav,
Try the following:
Regards, Samit Mehta |
Iteration iter = Use Samit's approach or alternatively, you can use ItemProfile.ITERATION_DEFAULT instead of IIteration.SMALL_PROFILE -- Regards, Patrick Jazz Work Item Team |
Thanks to your and Samits replies.
Another question I have is how to retrieve all iterations available for a project ares. I check the ProjectArea class and could not get a method for it. Thanks, Myroslav Iteration iter = Use Samit's approach or alternatively, you can use ItemProfile.ITERATION_DEFAULT instead of IIteration.SMALL_PROFILE -- Regards, Patrick Jazz Work Item Team |
Try:
IProjectArea.getDevelopmentLines() IDevelopmentLine.getIterations() IIteration.getChildren() --- Ryan Manwiller Jazz Team |