Problem creating WorkItem by Java APIs
Hi, i'm new to RTC, and i'm tryng to create a workitem using the examples in "WorkItem Java APIs" section, but i get an exception and a notification like:
Summary: Attribute 'ODC Activity' not set
Description: The 'ODC Activity' attribute needs to be set (work item <04>).
Summary: Attribute 'ODC Trigger' not set
Description: The 'ODC Trigger' attribute needs to be set (work item <04>).
......
Summary: Attribute 'Description' not set
Description: The 'Description' attribute needs to be set (work item <04>).
Obviously the problem is that some attributes are mandatory and i have to set them. So, how can I set an attribute of a workitem? I tried
workItem.setValue(IAttribute attr,Object value); but i don't know how get an IAttribute object. Sorry but i didn't find any documentation.
Summary: Attribute 'ODC Activity' not set
Description: The 'ODC Activity' attribute needs to be set (work item <04>).
Summary: Attribute 'ODC Trigger' not set
Description: The 'ODC Trigger' attribute needs to be set (work item <04>).
......
Summary: Attribute 'Description' not set
Description: The 'Description' attribute needs to be set (work item <04>).
Obviously the problem is that some attributes are mandatory and i have to set them. So, how can I set an attribute of a workitem? I tried
workItem.setValue(IAttribute attr,Object value); but i don't know how get an IAttribute object. Sorry but i didn't find any documentation.
One answer
On 3/15/10 5:08 PM, albjazz wrote:
You can get an IAttribute using the following method of IWorkItemClient:
IAttribute findAttribute(IProjectAreaHandle projectArea, String
identifier, IProgressMonitor monitor) throws TeamRepositoryException;
E.g.:
IAttribute descriptionAttribute=
findAttribute(workItem.getProjectArea(), IWorkItem.DESCRIPTION_PROPERTY,
monitor);
--
Regards,
Patrick
Jazz Work Item Team
Hi, i'm new to RTC, and i'm tryng to create a workitem using the
examples in "WorkItem Java APIs" section, but i get an
exception and a notification like:
Summary: Attribute 'ODC Activity' not set
Description: The 'ODC Activity' attribute needs to be set (work item
04>).
Summary: Attribute 'ODC Trigger' not set
Description: The 'ODC Trigger' attribute needs to be set (work item
04>).
.....
Summary: Attribute 'Description' not set
Description: The 'Description' attribute needs to be set (work item
04>).
Obviously the problem is that some attributes are mandatory and i have
to set them. So, how can I set an attribute of a workitem? I tried
workItem.setValue(IAttribute attr,Object value); but i don't know how
get an IAttribute object. Sorry but i didn't find any documentation.
You can get an IAttribute using the following method of IWorkItemClient:
IAttribute findAttribute(IProjectAreaHandle projectArea, String
identifier, IProgressMonitor monitor) throws TeamRepositoryException;
E.g.:
IAttribute descriptionAttribute=
findAttribute(workItem.getProjectArea(), IWorkItem.DESCRIPTION_PROPERTY,
monitor);
--
Regards,
Patrick
Jazz Work Item Team