It's all about the answers!

Ask a question

How get work Item Parent in the script dojo


Durand Guillaume (634) | asked Oct 28 '14, 9:03 a.m.
edited Oct 28 '14, 9:44 a.m. by Ralph Schoon (63.5k33646)
Hello,

I use RTC 4.0.1, I want to recover the value a attribut of WorkItem Parent in the script dojo. Is possible?



Comments
Ralph Schoon commented Oct 28 '14, 9:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Is this JavaScript in an attribute customization or your own web site?


Durand Guillaume commented Oct 28 '14, 9:37 a.m. | edited Oct 28 '14, 9:40 a.m.

attribute customization.

I want to recover the Work Item Parent in the dojo script.


Durand Guillaume commented Oct 28 '14, 9:41 a.m.

attribute customization.

I want to recover the Work Item Parent in the dojo script.

Accepted answer


permanent link
Ralph Schoon (63.5k33646) | answered Oct 28 '14, 9:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can't as far as I am aware. You can only access attributes. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript for what you can do. I tried to be more specific about what you can and can't in https://jazz.net/library/article/1093 at the beginning of Lab 5.

For some cases https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ could be a solution. Other approaches could be using Java Extensions. If there is a feasible approach depends on your use case.
Ralph Schoon selected this answer as the correct answer

Comments
Durand Guillaume commented Oct 28 '14, 10:46 a.m.

In my script dojo, I can access a field summary of work item Parent??


Ralph Schoon commented Oct 28 '14, 11:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As far as I am aware no.

From all I know, in an attribute customization script with JavaScript you neither get access to the link, nor (as a consequence) access to the element at the other end of the link (and so also not to its attributes).

You can access the attribute values of the work item context the script runs in. You have limited support for complex data types such as team areas and the like. Consider reading the links I put into the first answer.

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.