Custom calculated attribute not working
I'm brand new to attribute customization, and am trying to get a test to work.
Any advice is greatly appreciated.
Here is the javascript:
I have added it to Attribute Customization as a Calculated Value.dojo.provide("com.fmc.TestProvider");
(function() {dojo.declare("com.fmc.TestProvider", null, {
getValue: function(attribute, workItem, configuration) {
return "test";}});})();
I have added this custom attribute as an attribute to the Task WI as "readonly".
I have created a custom Editor Presentation for the Task WI to show the new attribute.
I am having the following issues:
1) I can't get it to show up in the Editor Presentation (I made some other changes that did take effect, so I know I'm in the right place).
2) I can get the new "test" attribute to show up in queries, but it has no value. I've tried to update a work item and save it, but it still shows no value in the query.
Any advice is greatly appreciated.
Accepted answer
Hi Carson,
new attributes don't show up on old work items. You have to create a new work item of the type to get them. They might appear as read only in case they show. You need to "Synchronize Attributes" see http://rsjazz.wordpress.com/2012/11/19/using-an-expression-to-synchronize-attributes-for-work-items-of-a-specific-type/ which has the link to https://jazz.net/library/article/529 which talks about how to do that in the Eclipse UI, if you want to see them in work items created be fore the attribute was added..
Please see https://jazz.net/library/article/1003 , https://jazz.net/library/article/130 and https://jazz.net/library/article/1093 for more information. We hope to be able to ship the labs on scripting in the last article soon.
If you synchronize the attributes or create a new work item, please check the logs if the scripting is enabled and runs as described here: https://jazz.net/wiki/bin/view/Main/AttributeCustomization if you don't see the default value in queries.
There is too few data on why the attribute does not show in the presentations. If you don't change them, you should at least see it in the custom tab of the eclipse work item editor. If it shows, start from there to get it into an editor presentation and be aware there are different ones for planning, creating work items as well as the work item editor itself.
new attributes don't show up on old work items. You have to create a new work item of the type to get them. They might appear as read only in case they show. You need to "Synchronize Attributes" see http://rsjazz.wordpress.com/2012/11/19/using-an-expression-to-synchronize-attributes-for-work-items-of-a-specific-type/ which has the link to https://jazz.net/library/article/529 which talks about how to do that in the Eclipse UI, if you want to see them in work items created be fore the attribute was added..
Please see https://jazz.net/library/article/1003 , https://jazz.net/library/article/130 and https://jazz.net/library/article/1093 for more information. We hope to be able to ship the labs on scripting in the last article soon.
If you synchronize the attributes or create a new work item, please check the logs if the scripting is enabled and runs as described here: https://jazz.net/wiki/bin/view/Main/AttributeCustomization if you don't see the default value in queries.
There is too few data on why the attribute does not show in the presentations. If you don't change them, you should at least see it in the custom tab of the eclipse work item editor. If it shows, start from there to get it into an editor presentation and be aware there are different ones for planning, creating work items as well as the work item editor itself.
Comments
showing 5 of 10
show 5 more comments
Comments
Brian Fleming
Nov 27 '12, 10:03 p.m.