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
Check the sample scripts here:
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
nannette Mori
commented Jun 30 '15, 2:13 p.m.
this is a custom attribute so how do I know what the attribute ID is Consider going through
Brian Fleming
commented Jun 30 '15, 3:27 p.m.
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.
|
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
A null indicates that the attribute with the ID passed in attribute is not set or the ID is not valid.