Access Children of Work Item
2 answers
There are several dependent on the context.
Comments
I need to access children of a work item in a custom attribute script in the EWM Client and check the type of it.
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.
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.
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