RTC 4.x attr. customization: Need help to get a calculated value based on the values set in two other attributes
![]()
Hi,
Let's say I have a work item type = "CustomType" with the following attribute configuration: Attribute A: integer - defaulted to "0" and with validator = "number greater or equal than 0". Attribute B: enumeration, with possible values: Pass, Fail, N/A, Not Assessed - defaulted to "Not Assessed" Attribute C: small string, having dependency on Attribute A and Attribute B and based on a "Script Based Calculated Value" provider. This is the logic I have followed to build the provider: if Attribute A = "Fail" or Attribute B = "Pass", then Attribute C = Attribute A, else if Attribute B = "N/A", then Attribute C = "0" And here is the script code I used to build "my_Provider": dojo.provide("com.example.my_Provider"); (function() { dojo.declare("com.example.my_Provider", null, { getValue: function(attribute, workItem, configuration) { var BAttribute= configuration.getChild("BAttribute").getIdentifier(); var AAttribute= configuration.getChild("AAttribute").getIdentifier(); if (BAttribute == "Fail" || BAttribute == "Pass") { return AAttribute; } else { if (BAttribute == "N/A") { return 0; } } } }); })(); After saving the configuration, if I performed the following steps: Scenario 1: 1) Created a work item based on type = "CustomType" 2) Entered a valid number on Attribute A, e.g. "5" 3) Selected "Pass" on Attribute B 4) Saved work item 5) Expected Result: Value displayed on Attribute C is 5" (= value entered on Attribute A) Actual Result: Value displayed on Attribute C is blank Scenario 2: 1) Created a work item based on type = "CustomType" 2) Entered a valid number on Attribute A, e.g. "8" 3) Selected "N/A" on Attribute B 4) Saved work item 5) Expected Result: Value displayed on Attribute C is "0" Actual Result: Value displayed on Attribute C is blank Could you please tell me what am I missing? FYI - I am using the RTC client on a jazz server v4.0.6 Thanks in advance! Vicky |