Trying to autopopulate date and time in a custom date attribute
In trying to get the work item attribute the return result is "null"
dojo.require("com.Ibm.team.wrkitem.api.common.workItemAttributes);
Var WorkItemAttributes=com.ibm.team.workitem.api.common.workItemAttributes
get value: funtion (attribute,workitem, configuration)
var return result = workItem.getvalue(attribute);
at this point what is being returned in the return result is "null" not the id of the attribute
Can you tell me what I am doing wrong? Thanks for your assistance!
One answer
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript
I don't think you're passing in a valid argument to workItem.getValue() (and you are using a lowercase "v" in your method call). You should be passing in the id of the attribute whose value you want returned or one of the built-in attributes like
WorkItemAttributes.SEVERITY (full list here: https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of)
Comments
this is a custom attribute so how do I know what the attribute ID is
Consider going through
When the attribute was created, an ID had to be specified. You can determine the id by opening the Project Area process specification in Eclipse, navigating to Project Configuration -> Configuration Data -> Work Items -> Types and Attributes, finding the attribute in question, double clicking it to bring up the "Edit Custom Attribute" dialog and using the value in the "ID" field.
Please also see https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript ans search for Timestamp for how to deal with the conversions needed.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jul 01 '15, 4:41 a.m.A null indicates that the attribute with the ID passed in attribute is not set or the ID is not valid.