Can I access a attribute value of a workitem from another workitem?
I have a scenrio where we have created a custom workitem which captures details of a users and his skill .As part of the page the reviewer assigns him a Skill Score . Issue : We will be capturing the data for various users in a department using the workitem . Now we need to find a combined Skill score of a department . For the same we need to access the skill score of all workitems and calculate the final value . How can I access skill Score from all workitems ?(using scipts ?) Please help suggest? |
One answer
Ralph Schoon (63.5k●3●36●46)
| answered Jul 04 '14, 3:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
JavaScript, as far as I am aware, only provides access to the attribute values of the current work item. Specifically what can be accessed is described here: https://jazz.net/wiki/bin/view/Main/AttributeCustomization
You can try to write a Java Based attribute customization. The Java API provides more access to data of that work item. I am not sure how far that carries with respect to e.g. following links to other work items. You can find what I explored here: https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ |
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.
Comments
best thing to do is run a query to find all the needed workitems,
then process them one by one to get the calculated value.
see my sample pgm on how to process from a query and access the attributes of the workitems.
see the answer here
https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes
note that the forum software messes with text case of thing near < and > so you will have a little fixup once u cut/paste.
then define a workitem query to get your workitems
the utility parms are
server_url userid password project_name and name_of_query_to execute
Thanks Sam . I am only using RTC and not writing any Java App for this .. what i have done previously is created a atttribute and attach a script based calculation to it for dynamic attribute values in same Workitem . can i use IWorkItemClient , IQueryClient and other such in Script based using DOJO code ??
Sorry. No idea if the JavaScript runtime env provides enough services to do that. Not likely in my experience .
The current client side scripting appears to be for attribute customization only, which is confined to the current work item. Even you can load other work items, if you are loading them one by one, it will be very slow. Unless you can run queries in client side scripts, which is a big ask.