How does one Get and Set value of Work Item's Found-In attribute programmatically?
2 answers
Please have a look at: https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation
You can use the operation also to update work items, this saves you trying to work with working copies.
You want to set the value of the attribute: com.ibm.team.workitem.attribute.version the data type is IDeliverables.
Some hint on IDeliverables: https://jazz.net/library/article/807 there are several ways to find them.
You can use the operation also to update work items, this saves you trying to work with working copies.
You want to set the value of the attribute: com.ibm.team.workitem.attribute.version the data type is IDeliverables.
Some hint on IDeliverables: https://jazz.net/library/article/807 there are several ways to find them.
Forgot: To set an internal attribute:
IWorkItemClient workItemClient= (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);
IAttribute attribute = workItemClient.findAttribute(workItem.getProjectArea(),
fAttributeID, monitor);
if(null!=attribute){
if(workItem.hasAttribute(attribute))
workItem.setValue(attribute, fValue);
}
To get use gatValue and cast. For custom attributes use hasCustomAttribute which also works for built in attributes.
IWorkItemClient workItemClient= (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);
IAttribute attribute = workItemClient.findAttribute(workItem.getProjectArea(),
fAttributeID, monitor);
if(null!=attribute){
if(workItem.hasAttribute(attribute))
workItem.setValue(attribute, fValue);
}
To get use gatValue and cast. For custom attributes use hasCustomAttribute which also works for built in attributes.