Get Links (related) in Javascript in Eclipse for RTC web
I need to be able to get the links associated with a workitem using the attribute customization javascript in eclipse to be used in RTC web client. I was looking online, and it looks like i can use getProxy(); like this:
var childLinks = workItem.getProxy().getValue({
path : [ 'linkTypes', 'com.ibm.team.workitem.linktype.parentworkitem' ]
});
path : [ 'linkTypes', 'com.ibm.team.workitem.linktype.parentworkitem' ]
});
which would get all parent links which would be great. but if i add this and just have return "test"; and attach to string attribute, i don't even see "test" ... it fails on this. I even tried just
var proxy = workItem.getProxy();
var linkArray = proxy.getValue({path:["linkTypes"]});
but still not working ... am i missing a dojo.require? or is this not possible in eclipse for web client?
Accepted answer
My JavaScript skills are almost non existent. I am also not sure what libraries you can get to in the Attribute Customization. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization for the documentation and my knowledge base. Keep in mind that in the EWM/RTC Eclipse client you do not have all the libraries you see in the web UI.
I do not know what you can do with the proxy. There are several posts here that explain what it does and how.
Access to work item link data is available in the Client/common/server Java API. See https://rsjazz.wordpress.com/?s=link+api&submit=Search
It is also possible to use the OSLC and other APIs to get themWith the correct access to the right Libraries JavaScript can use these APIs. I just can not tell you if you can use those in the RTC Eclipse client where the attribute customization is run when editing work items.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 21 '21, 10:20 a.m.Just so you know the code you are using is internal API. It also only works in the Web UI.
Michelle Rutkunas
Apr 21 '21, 10:40 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 21 '21, 11:06 a.m.This is an undocumented JavaScript method that only works in the Web UI in attribute customization. It can change at any time and stop working. That is what I mean with internal unsupported API. If something goes wrong support might not be able to help.
Michelle Rutkunas
Apr 21 '21, 11:51 a.m.