It's all about the answers!

Ask a question

Access Children of Work Item


Delaney Glassford (1111) | asked Jul 17, 9:27 a.m.

I need to access the Children of a Work Item and verify that the types are the same. Is there a way I can do this?

2 answers



permanent link
Ralph Schoon (63.6k33646) | answered Jul 18, 2:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

There are several dependent on the context.


Comments
Delaney Glassford commented Jul 18, 8:17 a.m.

I need to access children of a work item in a custom attribute script in the EWM Client and check the type of it.


Ralph Schoon commented Jul 18, 8:24 a.m. | edited Jul 18, 8:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

So why do you not provide this minimal amount of information in your original question?

That, as far as I know, is not supported in the public attribute customization JavaScript API. It has been asked many times now.
This is the "official" API description: https://jazz.net/wiki/bin/view/Main/AttributeCustomization
Note, it does not mention links, neither complex items.

My experience over the years: https://rsjazz.wordpress.com/2022/11/25/ewm-attribute-customization-introduction/

If you carefully search, you will find things like this: https://jazz.net/forum/questions/274622/get-links-related-in-javascript-in-eclipse-for-rtc-web

This is unsupported, internal API and it will only work in the Web UI. 


permanent link
Davyd Norris (2.9k217) | answered Jul 18, 6:08 p.m.
edited Jul 18, 6:10 p.m.
As Ralph said, this is an internal API and so is subject to change but you can use this:

const childItems = workItem.getProxy().getValue({ path : [ 'linkTypes', 'com.ibm.team.workitem.linktype.parentworkitem' ]} );

This will return an array of Objects that are link types, from which you'll be able to get some information. I can't remember if the Work Item type is in this but you should be able to use the info to get it

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.