我已经提到过:create/update user story using rally app sdk
这是我的代码:
_update_iteration_of_parent: function(pOID, iteration){ //iteration is the OID of iteration to be added.
console.log("Updating Iteration ",'/iteration/'+iteration);
var me = this;
Rally.data.ModelFactory.getModel({
type: 'User Story',
success: function (model){
var that = this;
//console.log("objectid #",objectid," latestpsi ",latestpsi);
this.model = model;
var id = pOID;
console.log("_readRecord ",id);
this.model.load(id,{
fetch: ['Name','Iteration'],
callback: function (record, operation){
//console.log('name .. ', record.get('Name'));
if(operation.wasSuccessful()){
console.log('Iteration ',record.get('Iteration'));
record.set('Iteration','/iteration/'+iteration);
record.save({
callback: function(record,operation){
if(operation.wasSuccessful()){
console.log("Operation Successful");
}
else
console.log("Not");
},
scope: this,
});
}
},
scope: this
});
}
});
}
我无法更新迭代,并且它总是记录“Not”,表示在调用record.set('Iteration','/ iteration /'+ iteration)时它不成功。获取pOID和迭代的值没有问题。
答案 0 :(得分:0)
您的方法称为_update_iteration_of_parent
,表示您正在尝试在父故事上设置迭代。如果这是真的,那就解释了设置迭代的失败。无法在UI或API中为迭代计划父(史诗)故事。