Access custom attribute in a Calculated attribute script
![]()
Alan Kan (61●1●13●10)
| asked Aug 31 '11, 5:27 a.m.
edited Apr 02 '13, 4:03 a.m. by Ralph Schoon (62.7k●3●36●43)
I would like to automatically assign a user to the Owned By field from a "user" custom attribute upon the work item being a certain state. I implement it as a scripted calculated attribute associated with the Owned By field. I can't figure out why my script does not work. It does not update the Owned By field, and it does not give me any error message in the log or on screen. I tried outputing a test string to the log file and it worked. So I have confirmed that I have the correct set up to run the script upon work item state changes. Would someone be able to tell me what I have done wrong??
My custom attributes are: <customAttribute id="buo" name="Business Unit Owner" type="contributor"/> <customAttribute id="tpa" name="Technical Process Analyst" type="contributor"/> Below is the script that I have associated as a Calculated Value with the Owned By field. dojo.provide("org.example.workitems.providers.CalculatedOwner"); Thanks, Alan |
2 answers
![]()
Ralph Schoon (62.7k●3●36●43)
| answered Dec 01 '11, 3:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi alan, this post is quite old, however the calculated values are pretty restricted in handling Item Types such as owner. Please have a closer look here: https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Debugging_scripts
For items like users the scripting does not yet work. Comments Hi, I have the same situation with alan, but I have tested that the opposite way is possible, I can assigned the build-in attribute to a custom attribute with both of contributor type, why is this, cannot we get the build-in attribute's value? |