RTC - The Value set is not activate .
Hello
I am trying to activate the Value set on deliverable field .
The value set is not activated , I do not get error , it just is not working.
I have tried to set the example value set to Small String field and it is not working also .
My script is :
dojo.provide("SetDeliverableField");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.string");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("SetDeliverableField", null, {
getValueSet: function(attributeId, workItem, configuration) {
var result= [];
var csci= workItem.getValue(WorkItemAttributes.FILED_AGAINST);
console.log(release);
var found= false;
var allReleases= configuration.getChildren("release");
for (var i= 0; i < allReleases.length; i++){
var r= allReleases[i];
var releaseName= r.getString("uuid")
if (releaseName.indexOf(csci)>-1) {
// If there is a configuration entry for this release use it
found= true;
result.push(releaseName)
}
}
}
if (!found) {
for (var i= 0; i < allReleases.length; i++){
var r= allReleases[i];
var releaseName= r.getString("uuid")
result.push(releaseName)
}
}
return result;
}
Please advice ...
Thanks in advance.
I am trying to activate the Value set on deliverable field .
The value set is not activated , I do not get error , it just is not working.
I have tried to set the example value set to Small String field and it is not working also .
My script is :
dojo.provide("SetDeliverableField");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.string");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("SetDeliverableField", null, {
getValueSet: function(attributeId, workItem, configuration) {
var result= [];
var csci= workItem.getValue(WorkItemAttributes.FILED_AGAINST);
console.log(release);
var found= false;
var allReleases= configuration.getChildren("release");
for (var i= 0; i < allReleases.length; i++){
var r= allReleases[i];
var releaseName= r.getString("uuid")
if (releaseName.indexOf(csci)>-1) {
// If there is a configuration entry for this release use it
found= true;
result.push(releaseName)
}
}
}
if (!found) {
for (var i= 0; i < allReleases.length; i++){
var r= allReleases[i];
var releaseName= r.getString("uuid")
result.push(releaseName)
}
}
return result;
}
Please advice ...
Thanks in advance.
One answer
Debug your code carefully as there are many errors in your code. If you check the ccm.log file (the script is executed on the server side), you should see errors there, and you will see any error in the browser. Here are some obvious errors that I can see in your code.
1. The variable "release" is never defined.
2. The last "if" block is outside of the "getValueSet: function" block. (How did you manage to do that?)
3. Some lines of code are missing the ending semicolon(;).
4. The entire script is not properly terminated (if you have posted the code completely).
1. The variable "release" is never defined.
2. The last "if" block is outside of the "getValueSet: function" block. (How did you manage to do that?)
3. Some lines of code are missing the ending semicolon(;).
4. The entire script is not properly terminated (if you have posted the code completely).
Comments
Don Yang
Aug 20 '15, 7:27 p.m.Have you set the property Enable Process Attachment Scripts to true(https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript)? Did you see any info in ccm.log file as you have
console.log(release);in the script? you may want to insert more console.log() to the script and see what are returned during runing.