Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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!

0 votes

Comments

A null indicates that the attribute with the ID passed in attribute is not set or the ID is not valid.



One answer

Permanent link
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)

0 votes

Comments

this is a custom attribute so how do I know what the attribute ID is

Consider going through

there are numerous examples. The code above is too incomplete to say anything.

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

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Jun 30 '15, 11:54 a.m.

Question was seen: 2,665 times

Last updated: Jul 01 '15, 4:41 a.m.

Confirmation Cancel Confirm