It's all about the answers!

Ask a question

How do I access child workitems via Java Script ?


Takehiko Amano (1.3k3741) | asked Sep 28 '11, 5:49 a.m.
JAZZ DEVELOPER
Hi,

I wonder if it is possible to access child records via Java Script used in attribute customization. For example,

https://jazz.net/wiki/bin/view/Main/AttributeCustomization

lists all possible attributes accessed via "com.ibm.team.workitem.api.common.WorkItemAttributes" class.

I suspect there might be other "com.ibm.team.workitem.api.common.XX" class which enables to access child workitems.

Use Case is like as follows:

Child workitems set value: X (i := workitem ID for example )
Parent workitem compute like: X
(e.g. Total sum of X)

Actual usage can be:

- Average timespent / Maxmium timespent / minimum timespent
- Total cost of parent workitems (in time)
- etc, etc

If it is not possible, I'm going to change my design to use Java.

2 answers



permanent link
Paul Wellman (71119) | answered May 07 '12, 11:35 a.m.
Hi,
By any chance did you figure out if this was possible? I am trying to complete the exact same customization.

Are you able to access values in the children work items via javascript? If so, would you happen to have any example code?

Thank you.

Paul



Hi,

I wonder if it is possible to access child records via Java Script used in attribute customization. For example,

https://jazz.net/wiki/bin/view/Main/AttributeCustomization

lists all possible attributes accessed via "com.ibm.team.workitem.api.common.WorkItemAttributes" class.

I suspect there might be other "com.ibm.team.workitem.api.common.XX" class which enables to access child workitems.

Use Case is like as follows:

Child workitems set value: X (i := workitem ID for example )
Parent workitem compute like: X
(e.g. Total sum of X)

Actual usage can be:

- Average timespent / Maxmium timespent / minimum timespent
- Total cost of parent workitems (in time)
- etc, etc

If it is not possible, I'm going to change my design to use Java.

permanent link
Ralph Schoon (63.4k33646) | answered May 08 '12, 3:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Paul,

as far as I can tell, this is not possible using javascript today. You would have to create a followup action. Javascript just does not expose relationships.
See https://jazz.net/forums/viewtopic.php?t=24412 for more details.

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.