[closed] Getting Attributes of a Defect work items
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
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
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?
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
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
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
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?
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)
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
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,
Myroslav
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)
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?
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
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
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
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?
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
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?
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
Use Samit's approach or alternatively, you can use
ItemProfile.ITERATION_DEFAULT
instead of
IIteration.SMALL_PROFILE
--
Regards,
Patrick
Jazz Work Item Team
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 =
auditableClient.resolveAuditable(iterHandle,IIteration.SMALL_PROFILE,
monitor);
But there is no attriubute IIteration.SMALL_PROFILE in class
IIteration. Am I doing something wrong?
Use Samit's approach or alternatively, you can use
ItemProfile.ITERATION_DEFAULT
instead of
IIteration.SMALL_PROFILE
--
Regards,
Patrick
Jazz Work Item Team
page 1of 1 pagesof 2 pages