It's all about the answers!

Ask a question

Add related to a ticket via api java server


Emiliano Iannetti (114) | asked May 14 '20, 3:43 p.m.
Hi everyone. We have to add an existing one related to a newly created ticket from 0, at the same time we also have to add some child tickets.
Now until the creation of the parent and the child, we are there.
I can also add a related one, but only one, since from the second onwards I return AssertionFailed, without giving me references to the source that executes it.
I have this code:
WorkItemReferences referencesWp = (WorkItemReferences) workItemServer.resolveWorkItemReferences (workitemWpCopy, monitor); --> workitemWpCopy is the copy of the wi that must be added as related.
The reference is related and with the line:
referencesWp.add (referenceTypeWp, referenceWp);
--> referenceTypeWp is of type RELATED_WORK_ITEM
--> referencesWp is: (WorkItemReferences) workItemServer.resolveWorkItemReferences(workitemWpCopy, monitor);
As long as only one is correctly added. However, we need to add more than one and I can't find a way to do it. Even saving every addition and repeating the operation with a copy of both WI that are correlated does not go, however from the frontend it is allowed to add more correlates at the same time, so I do not understand why the API side this is not possible.
We are using RTC 6.0.5 and the server side bees.
I hope for your help.
P.S. I have already seen Ralph's blog page, but he talks about them on client-side bees and I have not found any correlation with what I am looking for on the server side. Thanks.

One answer



permanent link
Ralph Schoon (63.7k33648) | answered May 15 '20, 3:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 I am sorry, but I don't really understand what you try to do or what the problem is. 


I am assuming you possibly want to create a follow up action that
  • creates work items and also 
  • create a link between work items as well.

All of the above can be done. https://rsjazz.wordpress.com/2016/10/24/using-the-work-item-server-api-to-create-work-items/ shows some of the code you would typically use.


Comments
Emiliano Iannetti commented May 15 '20, 4:31 a.m.

 Imagine well but the problem is that I already have the Operation participant that takes care of everything, I can create a parent workitem and create and connect it and a child workitem. But the moment I try to add a related one, if there are more than one, it bursts me and does not allow me to do it.

In the previous post I used the API bees that I found, unfortunately I can't manage multiple insertion, that is, the insertion of multiple correlates.


Ralph Schoon commented May 15 '20, 5:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Sorry, but the problem is lost in translation. Unless you can provide a more meaningful description of the problem, I can't help. 

Your answer


Register or to post 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.