Error while fetching the parent work item type
ISaveParameter data = (ISaveParameter) serviceUtils.getOperation().getOperationData();
List<IEndPointDescriptor> parentList = data.getNewReferences().getChangedReferenceTypes();
List<IEndPointDescriptor> parentList = data.getNewReferences().getChangedReferenceTypes();
System.out.println("parent list size::::"+parentList.size());
System.out.println("1:::::"+parentList.get(0).getDisplayName());
output:
parent list size::::0
09:26:25,992 [526458721@qtp-1491425509-9 @@ 09:25 TestJazzAdmin1 <com.ibm.team.repository.transport.client.RemoteTeamService spnego-enabled@127.0.0.1> /jazz/service/com.ibm.team.workitem.common.internal.IWorkItemRepositoryService] ERROR c.extensions.workitem.service.impl.TaskServiceImpl - Index: 0, Size:
Accepted answer
I try to provide a beginners guide here: https://rsjazz.wordpress.com/
I understand the API is not trivial - I am working against it for several years now and I still find a lot of cases where I don't know the API and have to search for examples in the SDK or in the net. This happens almost every time I try something new. So regardless how many beginner guides we would write, every beginner will always feel that there should be something else in there.
Setting up Rational Team Concert for API Development and the Extensions Workshop and Understanding and Using the RTC Java Client API and What API's are Available for RTC and What Can You Extend? and various other posts are meant to be beginners guides. There are many examples on the blog that you can follow, assuming you have set up your environment for debugging as described in the Extensions Workshop.
In the link I mentioned in my initial answer all those are kind of accessible in the introduction "If you are just starting".
In addition if you download the code and actually look into the code you find this code piece:
I understand the API is not trivial - I am working against it for several years now and I still find a lot of cases where I don't know the API and have to search for examples in the SDK or in the net. This happens almost every time I try something new. So regardless how many beginner guides we would write, every beginner will always feel that there should be something else in there.
Setting up Rational Team Concert for API Development and the Extensions Workshop and Understanding and Using the RTC Java Client API and What API's are Available for RTC and What Can You Extend? and various other posts are meant to be beginners guides. There are many examples on the blog that you can follow, assuming you have set up your environment for debugging as described in the Extensions Workshop.
In the link I mentioned in my initial answer all those are kind of accessible in the introduction "If you are just starting".
In addition if you download the code and actually look into the code you find this code piece:
private IWorkItemHandle findParentHandle(ISaveParameter saveParameter, IProgressMonitor monitor) throws TeamRepositoryException { // Check to see if the references contain a 'Parent' link ListI don't know if you actually read the post that I send in my first answer. I don't have the impression you did. So I question why I actually spend the precious time toreferences = saveParameter.getNewReferences() .getReferences(WorkItemEndPoints.PARENT_WORK_ITEM); if (references.isEmpty()) return null; // Traverse the list of references (there should only be 1 parent) and // ensure the reference is to a work item then return a handle to that // work item for (IReference reference : references) if (reference.isItemReference() && ((IItemReference) reference).getReferencedItem() instanceof IWorkItemHandle) return (IWorkItemHandle) ((IItemReference) reference) .getReferencedItem(); return null; }
- Create the examples
- Answer the question
However, more examples code for the link API can be found here: https://rsjazz.wordpress.com/?s=link
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Sep 26 '15, 11:54 p.m.For the next questions you want to ask, please see this guidance: How should I ask a question in the Forum if I want to receive useful answers?
For this one: I can't see an error. This is probably just wrong usage of the API. See https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ for an example.
Mahesh Vasamsetti
Sep 26 '15, 11:54 p.m.Thank you Ralph Schoon. I Appreciate your quick response and useful suggestions all the time. I understand your frustration, you may be seeing such questions all the time, so may be thinking like waste of time.