How to read the bulit-in attribute value using dojo script in rtc eclipse?
Hi
Accepted answer
hi Mohanakrishnan,
have you looked at this already :
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_an_item_s_Status_attri
Comments
Other than in the question the Status attribute does not have the ID mentioned above com.ibm.team.workitem.attribute.state. The wrong ID com.ibm.team.workitem.attribute.state is caused by https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/219100
If WorkItemAttributes.STATE does not work, the reason is usually an error e.g. not declaring
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
.
If the link provided by Dinesh is not enough see https://jazz.net/library/article/1093 Lab 5. The JavaScript is crap (I am no a JavaScript developer) but at least the examples work and are explained. There is an example looking at the state.
do you have the require on WorkItemAttributes ?
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
The above is not a script. I would suggest doing a step by step following https://jazz.net/library/article/1093 . Providing insufficient parts of the code will only cost everybody time.
Thanks Dinesh and Ralph. I think the issue with declaration. Its working fine with below statements.
You are not supposed to use alert in AttributeCustomization. Use console.log as shown in https://jazz.net/wiki/bin/view/Main/AttributeCustomization .