condition values returning null
![](http://jazz.net/_images/myphoto/0023458f1b2223084d2a5830269738a3.jpg)
i am trying to make a text field mandatory when an option from drop down is selected.
(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.workitems.providers.testcasepreparation", null, {
matches: function(workItem, configuration) {
var sev = workItem.getValue(WorkItemAttributes.SubTaskdetails3);
debugger;
alert (sev)
return (sev === "dailytasksubcategory.literal.l1");
}
});
})();
but when i am executing the script it is returning null.
pls tell what we need to pass id or the attribute name
dropdown Attribute name : Sub Task details
ID :SubTaskdetails3
i have done the setting for operation behavior too but return value shows null.
pls help us in scripting this.
and in jaxx admin settings Enable Process Attachment Scripts is true.
Script:
dojo.provide("org.example.workitems.providers.testcasepreparation");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.workitems.providers.testcasepreparation", null, {
matches: function(workItem, configuration) {
var sev = workItem.getValue(WorkItemAttributes.SubTaskdetails3);
debugger;
alert (sev)
return (sev === "dailytasksubcategory.literal.l1");
}
});
})();
Accepted answer
![](http://jazz.net/_images/myphoto/0023458f1b2223084d2a5830269738a3.jpg)
>WorkItemAttributes.SubTaskdetails3
what is the TEXT ID of the attribute?
WorktiemAttributes. only works for the pre-defined variables.
all the others need the TEXT ID string..
I name my custom attributes something like
"com.sd.tools.custom.attribute.defect.foo"
so, when anyone looks at it, they know where it came from and where it is used.
the string should be used where the 'WorkItemAttributes.SubTaskdetails3' value is..
workItem.getValue("com.sd.tools.custom.attribute.defect.foo");
what is the TEXT ID of the attribute?
WorktiemAttributes. only works for the pre-defined variables.
all the others need the TEXT ID string..
I name my custom attributes something like
"com.sd.tools.custom.attribute.defect.foo"
so, when anyone looks at it, they know where it came from and where it is used.
the string should be used where the 'WorkItemAttributes.SubTaskdetails3' value is..
workItem.getValue("com.sd.tools.custom.attribute.defect.foo");
One other answer
![](http://jazz.net/_images/myphoto/0023458f1b2223084d2a5830269738a3.jpg)
If you want to do this, you have to actually read the documentation available.
Those are https://jazz.net/wiki/bin/view/Main/AttributeCustomization and
Lab 4 and 5
The built in attributes have constants as described in https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of
WorkItemAttributes.SubTaskdetails3 is definitely not on the list and so you have to pass its ID as string. You can find the ID for attributes in the RTC Administration Web UI.
So you would call like
workItem.getValue("the.id.of.the.attribute.SubTaskdetails3");
Maybe
workItem.getValue("SubTaskdetails3");
You use console.log as described in the links above and not alert.
Also see https://rsjazz.wordpress.com/2016/06/17/javascript-attribute-customization-where-is-the-log-file/
Those are https://jazz.net/wiki/bin/view/Main/AttributeCustomization and
![](https://jazz.net/_images/blank.gif)
The built in attributes have constants as described in https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of
WorkItemAttributes.SubTaskdetails3 is definitely not on the list and so you have to pass its ID as string. You can find the ID for attributes in the RTC Administration Web UI.
So you would call like
workItem.getValue("the.id.of.the.attribute.SubTaskdetails3");
Maybe
workItem.getValue("SubTaskdetails3");
You use console.log as described in the links above and not alert.
Also see https://rsjazz.wordpress.com/2016/06/17/javascript-attribute-customization-where-is-the-log-file/
Comments
![](http://jazz.net/_images/myphoto/e5e63d5878217b64611c1df9401b7cd3.jpg)
I have already shared all these links above in other answers to your questions. If you are not willing to spend time reading these resources, my experience is, you will fail with attribute customization. You will basically hope and wait for others to fix your scripts, which will not work forever.
Comments
kesav d
Aug 12 '16, 12:08 a.m.thank u so much . it is working now