It's all about the answers!

Ask a question

How to get the ascending oreder of references in the RTC serverside plugin code


Govindaraj Ponnusamy (114) | asked Jun 01 '16, 4:59 a.m.
Hi All,

I would like to get the latest child references when trying to update the values from Parent workitems.

List<IReference> references = saveParameter.getNewReferences()
.getReferences(WorkItemEndPoints.CHILD_WORK_ITEMS);

output:
-------

Updating the Task Attibute Value '[com.ibm.team.links.internal.links.impl.ReferenceImpl@22c8b74 (internalId: [UUID _jo1jFifFEeaAT4XHrLlahw]) (uri: <unset>, referenceType: ITEM_REFERENCE, comment: 10: D3, referenceSide: <unset>, extraInfo: null, contentType: <unset>), com.ibm.team.links.internal.links.impl.ReferenceImpl@25f0c48b (internalId: [UUID _gm0jkCfFEeaAT4XHrLlahw]) (uri: <unset>, referenceType: ITEM_REFERENCE, comment: 8: D1, referenceSide: <unset>, extraInfo: null, contentType: <unset>), com.ibm.team.links.internal.links.impl.ReferenceImpl@77f7efee (internalId: [UUID _uh54ACe9EeaZ1pj5unSirw]) (uri: <unset>, referenceType: ITEM_REFERENCE, comment: 9: D2, referenceSide: <unset>, extraInfo: null, contentType: <unset>)]'.

In the above output, I would like to call the latest child workitem. The workitem ids are 8,9,10. But in the List it is showing 10,8,9. How to get in the acending order of the references like 8,9,10

Thanks in Advanced.
Regards.
Govindaraj.

One answer



permanent link
Ralph Schoon (59.7k23643) | answered Jun 01 '16, 6:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I don't think the list cares what the latest is, it also does not care for the work item ID's. If you want an order in the results, you have to order the data yourself.

Your answer


Register or to post your answer.