Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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' ]
    });

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?

0 votes

Comments

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

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?


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. 

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
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

0 votes

Comments

I did additional editing here, just so you know.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 1,700

Question asked: Apr 21 '21, 7:34 a.m.

Question was seen: 974 times

Last updated: Apr 21 '21, 3:42 p.m.

Confirmation Cancel Confirm