How to use createAttachment to upload attachments on server using RTC Java API
![](http://jazz.net/_images/myphoto/33f6db65677fc21451fd2e92fcbd78b2.jpg)
3 answers
![](http://jazz.net/_images/myphoto/33f6db65677fc21451fd2e92fcbd78b2.jpg)
IWorkItemCommon.createAttachment(projectArea, monitor)
Then you use the code from IWorkItemClient....
IAttachment attachment= IWorkItemCommon.createAttachment(projectArea, monitor); Attachment attachment= (Attachment) fAuditableCommon.createAuditable(IAttachment.ITEM_TYPE); attachment.setName(name); attachment.setDescription(description); IContent content= fTeamRepository.contentManager().storeContent(contentType, characterEncoding, inputStream, null, monitor); attachment.setContent(content);The WorkItemCommon should be available in the server API. The rest should be doable with the server API.
![](http://jazz.net/_images/myphoto/33f6db65677fc21451fd2e92fcbd78b2.jpg)
Comments
![](http://jazz.net/_images/myphoto/33f6db65677fc21451fd2e92fcbd78b2.jpg)
It's strange that it could not find ITeamRepository or IContentManager in the SDK libraries.
![](http://jazz.net/_images/myphoto/e5e63d5878217b64611c1df9401b7cd3.jpg)
Not sure how your setup looks like, but I have multiple hits if I do a search for references or a Java class search.
![](http://jazz.net/_images/myphoto/33f6db65677fc21451fd2e92fcbd78b2.jpg)
I followed your extension workshop development. Everything seems working fine. Is it because I am using the 3.0.1.x version?
![](http://jazz.net/_images/myphoto/e5e63d5878217b64611c1df9401b7cd3.jpg)
No, independent of the version you should have plenty of hits. ITeamRepository shows several thousand times in my setup. Check if https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/ and the following post https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ help. DId you add the sources to the Java Search as explained in the first lab of the Extensions Workshop? If not, do it again.