2011년 11월 20일 일요일
Client API - 작업항목에 문서첨부
repo.login(monitor);
IWorkItemClient workItemClient = (IWorkItemClient) repo.getClientLibrary(IWorkItemClient.class);
IWorkItemWorkingCopyManager copyManager = workItemClient.getWorkItemWorkingCopyManager();
IWorkItemHandle workItemHandle = workItemClient.findWorkItemById(workItemNumber, IWorkItem.FULL_PROFILE, monitor);
copyManager.connect(workItemHandle, IWorkItem.FULL_PROFILE, monitor);
WorkItemWorkingCopy workItemCopy = copyManager.getWorkingCopy(workItemHandle);
//IWorkItem workItem = workItemCopy.getWorkItem();
File file = new File("C:/FileToAttache.txt");
IReference fileRef = IReferenceFactory.INSTANCE.createReferenceFromURI(file.toURI(), file.getName());
IWorkItemReferences references = workItemCopy.getReferences();
references.add(WorkItemEndPoints.ATTACHMENT, fileRef);
IDetailedStatus saveStatus = workItemCopy.save(monitor);
System.out.println("Save Status : " + (saveStatus.isOK() ? "Success" : "Fail"));
TeamPlatform.shutdown();
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기