It's all about the answers!

Ask a question

create parent/children relationship


Christophe Doré (63) | asked Jun 06 '08, 1:12 p.m.
Hi
say that in my code, I create a bunch of atomic Wotk Items and I want to
group them under the same parent Work Item that I create on that purpose.

I did not see how to set this parent-child relationship. what is the
code to write to do so?

Thanks

Regards

--
cd

One answer



permanent link
Patrick Streule (4.9k21) | answered Jun 10 '08, 6:01 a.m.
JAZZ DEVELOPER
say that in my code, I create a bunch of atomic Wotk Items and I want to
group them under the same parent Work Item that I create on that purpose.

I did not see how to set this parent-child relationship. what is the
code to write to do so?

Please take a look at IWorkItemReferences, WorkItemLinkTypes and
WorkItemEndPoints. A rough sketch of the code that you need would be:

private void setParent(WorkItemWorkingCopy wc, IWorkItem parent) {
IEndPointDescriptor referenceType= WorkItemEndPoints.PARENT_WORK_ITEM;
IReference reference= WorkItemLinkTypes.createWorkItemReference(parent);
wc.getReferences().add(referenceType, reference);
}

HTH,
Patrick
Jazz Work Item Team

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.