Adding attachements/links to the work item programmatically.
Hi
I need to add the attachment and link to the workitem using RTC Java API's in the Links section. I tried to find the API for this but have not got any thing which can help me. Please let me know,if anyone has any idea about this? |
7 answers
Ralph Schoon (63.5k●3●36●46)
| answered Feb 01 '11, 12:18 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi, I am
Working on that myself right now. Here is what I found searching this forum: http://jazz.net/forums/viewtopic.php?t=2944&highlight=parent+child http://jazz.net/forums/viewtopic.php?t=14733&highlight=parent+child https://jazz.net/wiki/bin/view/Main/ProgrammaticLinkCreation Sorry have not had time to code yet. Ralph Hi |
Hi, I am Hi |
I haven't done this specifically for an attachment, but perhaps something like:
IURIReference ref = ReferenceFactory.INSTANCE.createReferenceFromURI(file.getURI()); workingCopy.getReferences().add(WorkItemEndPoints.ATTACHMENT); where file is the file instance? Susan Hi, I am Hi |
Ralph Schoon (63.5k●3●36●46)
| answered Feb 04 '11, 1:13 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Susan,
I am still stalled on this one. Of course it is possible to link to a URL like File://....... But for a real attachment, I figure the file needs to be uploaded and attached to a work item. I have not found the API for uploading yet. I think that is the key. Ralph I haven't done this specifically for an attachment, but perhaps something like: Hi, I am Hi |
Ralph Schoon (63.5k●3●36●46)
| answered Feb 04 '11, 5:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,
I searched the SDK for WorkItemEndPoints.ATTACHMENT and was able to find the code below. I haven't tested it but it is probably a good starter anyway.
Thanks, Ralph |
That was a great starter. Here's what ended up working for me -
|
Dear Ralph,
i created one custom link type, i want add automatically parent & chilled relationship when custom links are added, do you have any suggestion on this. My link is as below: <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension point="com.ibm.team.repository.common.linkTypes"> <linkType id="com.ibm.team.workitem.linktype.ncbcr" constrained="false" internal="false"> <target> <endpoint displayName="Project" id="project" multiplicity="0..n"> <itemReferenceType itemTypeName="WorkItem" packageURI="com.ibm.team.workitem"/> </endpoint> </target> <source> <endpoint displayName="Change Request" id="changerequest" multiplicity="0..1"> <itemReferenceType itemTypeName="WorkItem" packageURI="com.ibm.team.workitem"/> </endpoint> </source> </linkType> </extension> </plugin> |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.