RTC API for working with attachment
I am writing an Advisory to make compulsory the attachments before saving the work item.
When I am using following code:
WorkItemReferences refs = (WorkItemReferences) workItem;
List<IReference> test =refs.getReferences(WorkItemEndPoints.ATTACHMENT);
I am getting warning :
Discouraged access: The method getReferences(IEndPointDescriptor) from the type WorkItemReferences is not accessible due to restriction on required library C:\RTC601DEV\installs\rtc-sdk\plugins\com.ibm.team.workitem.common_3.2.500.v20151021_2014.jar
When I am using following code:
WorkItemReferences refs = (WorkItemReferences) workItem;
List<IReference> test =refs.getReferences(WorkItemEndPoints.ATTACHMENT);
I am getting warning :
Discouraged access: The method getReferences(IEndPointDescriptor) from the type WorkItemReferences is not accessible due to restriction on required library C:\RTC601DEV\installs\rtc-sdk\plugins\com.ibm.team.workitem.common_3.2.500.v20151021_2014.jar
Accepted answer
https://rsjazz.wordpress.com/2012/09/21/downloading-attachments-from-work-items/ and https://rsjazz.wordpress.com/2012/08/01/uploading-attachments-to-work-items/
Comments
Hello Ralph Thanks for the links ..
I got he attachments like :
List<IReference> relatedRefs = ((ISaveParameter) data).getNewReferences().getReferences(WorkItemEndPoints.ATTACHMENT); System.out.println("Links = "+ relatedRefs.size());
for (IReference link : relatedRefs)
{
System.out.println("Link type is +" + link.getLink().getLinkTypeId());
}