How to make a shared calculated field read-only in one workitem and writable in other?
Pravin Patil (104●1●46●134)
| asked Apr 12 '16, 5:49 p.m.
edited Apr 20 '16, 6:52 a.m. by Ralph Schoon (63.6k●3●36●46) I have 2 workitems with id's "scr" and "sir" Workitem "scr" has a tab "Test Impact", which has calculated fields "ETC1", "ETC2" etc. The sum of these calculated fields is populated on "Overview" tab of the "scr" workitem in a read-only calculated field called as "ETC" .
"sir" shares the ETC attributes from "scr" and has same structure as "scr" i.e. "Team Impact" tab, "ETC1", "ETC2" etc. The sum of these calculated fields is populated on "Overview" tab of the "sir" workitem in a read only field called as "ETC".
The requirement is to retain single ETC field in scr and sir, but should be writable in sir and auto-calculated in scr.
Below is the ETC calculated script.
(function() {
|
Accepted answer
Within "else" I returned value that gets entered in the ETC field. So the final code is as below.
_______
dojo.provide("example.calculated.sumALL");
______ Ralph Schoon selected this answer as the correct answer
|
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
Using alert() for debugging is a bad idea. Stick with console.log(). Note that the script may be executed on the server side and alert() would give you nothing.
SCR and SIR are no valid work item ID's. A work item ID would be 12345.
The else case is syntactically incorrect the script is a function and it must return a value. A function can no not return a value. You could read the current value of that attribute and return the same value.
Thanks Donals, Ralph, it works for me now.
Can you to the benefit of all forum members
Do it in an answer so I can accept it.