I can create workitems, set their title/descriptions and other attributes and commit to repo successfully.
I created 1 work item, letâ€™s say â€œold work itemâ€. And then I create another 1 work item, say â€œnew work itemâ€. Both are being created.
I am trying to link this â€œnew work itemâ€ with the â€œold work itemâ€
But seems like â€œ.setLinkedWorkItems(..)â€ is not working, or maybe I am missing something. The programs compiles and runs without any warning.
Here is a piece of code from the context. Have a look.
Code: Select all
sessionService.beginTransaction(); // to do just one TX
//newWorkItem(..) is my custom function which uses workitem constructor/setters to create & return a simple workitem
WorkItem wi1 = newWorkItem("old related work item", "to be revise", "critical");
String wiURI1 = trackerService.createWorkItem(wi1);//create it
//also tried commit and start new transaction, didn't worked
//preparing the LinkedWorkItem for the "setLinkedWorkItems" method
LinkedWorkItem lwi= new LinkedWorkItem();
LinkedWorkItem lwitm = new LinkedWorkItem;//just one element for time being.
WorkItem wi2 = newWorkItem("new updated work item", "will have links to old workitems", "urgent");
String wiURI2 = trackerService.createWorkItem(wi2);//create it
System.out.println(wiURI2+ " created too!");
sessionService.endTransaction(false);//false for No rollback but commit to repo
Your suggestions might be helpful. Thanks!