Calulated Values using Script Based for a Custom Attribute
![]()
I have two attributes in FPM :TIME_SPENT & ESTIMATE ,
I have created an custome attribute by name Completedp with id pc my Script is as follows dojo.provide("com.example.ValueProvider"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { dojo.declare("com.example.ValueProvider", null, { getValue: function(attribute, workItem, configuration) { var r1=workItem.getValue(WorkItemAttributes.TIME_SPENT) var r2=workItem.getValue(WorkItemAttributes.ESTIMATE) return (r1/r2*100); } }); })(); I am not able to see the results in custom attribute .Please some one help me in this script. |
Accepted answer
![]()
like sam suggested earlier, you could run these scripts with console.log at various places to see where the execution is failing... the log is printed to the .log file under .metadata in the eclipse workspace, you will find the log entries in these files:
Server: JazzTeamServer/server/tomcat/work/Catalina/localhost/ccm/eclipse/workspace/.metadata/.log Eclipse client: client/eclipse/workspace/.metadata/.log on the Web UI, you could use any generic script debugger, Firebug is my favorite. here is a lot of information on how you could debug the Web UI https://jazz.net/wiki/bin/view/Main/WorkItemsWebDebugging to me, the code appears fine after applying the correction suggested by Sam. another approach that you might want to try is to start with a default script and then start adding your functionality one line at a time to reach to the problematic piece of code hope this helps Girish Chandra P selected this answer as the correct answer
|
5 other answers
![]()
Hello Dinesh / Sam Detweiler ,
Thanks for your kind help and support. I did a mistake when binding the type to the custom attribute , ( I made it has type contributor instead of long). After instering the debug/Log I could check the answer in logs and corected the same . Thanks for your kind support. Girish |