It's all about the answers!

Ask a question

Get Links (related) in Javascript in Eclipse for RTC web


Michelle Rutkunas (132) | asked Apr 21 '21, 7:34 a.m.
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' ]
    });

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?


Comments
Ralph Schoon commented Apr 21 '21, 10:19 a.m. | edited Apr 21 '21, 10:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Just so you know the code you are using is internal API. It also only works in the Web UI.


Michelle Rutkunas commented Apr 21 '21, 10:40 a.m.
so, it won't work with a script based calculated value in attribute customization?

when you say internal api .. do you mean Java client API?



Ralph Schoon commented Apr 21 '21, 11:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


I know it is used by others, but I wanted to let you know the background. 


Michelle Rutkunas commented Apr 21 '21, 11:51 a.m.
ok thank you!

is there any way to just get the links of a workitem using the Javascript API? or is it only possible via Java server api?

Accepted answer


permanent link
Ralph Schoon (63.4k33646) | answered Apr 21 '21, 3:35 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 21 '21, 3:39 p.m.
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.

Michelle Rutkunas selected this answer as the correct answer

Comments
Ralph Schoon commented Apr 21 '21, 3:42 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I did additional editing here, just so you know.

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.