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

Can EWM Calculated Value dojo read if there is a parent/child link for the Work Item

I am able to read the Custom Attribute values through a dojo script configured with Calculated Value.

From dojo, I wanted to check if there is any link associated to that Work Item & Link Type. 
When adding Dependencies to the attribute, while all the Attributes are present, Links are not configurable as dependencies.

0 votes



2 answers

Permanent link
You're correct, you can't set up dependencies on links, but you can get link information via the workItemProxy. Note that the use of the work item proxy is undocumented and therefore subject to change, so use at your own risk.

The following call will retrieve all links of the specified type, and return them as an array of objects that can then be further queried for basic information

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

0 votes


Permanent link
Thank you @davydnorris.

Following code in calculated value is able to fetch all links that were present before opening the work item.
const children = workItem.getProxy().getValue({ path : [ 'linkTypes']} );
But if the link is newly created & the Save button is pressed, newly created link is not read by the script. This means Script does not work onSave operation.
How to make the script work onSave operation.

0 votes

Comments

That's correct - I'm not sure how you would get links that haven't yet been committed. They would have to be stored in the proxy somewhere, but they technically don't exist until they're committed - if the browser is closed or refreshed it's as if they were never there 

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
× 11,053

Question asked: May 29, 10:32 a.m.

Question was seen: 644 times

Last updated: May 30, 5:56 a.m.

Confirmation Cancel Confirm