Rally 是否有方法批量创建故事并将其分配给迭代?
我们每个月都会这样做,并希望在未来的迭代中自动创建和安排故事。我们在几次Sprint之前就研究过这一点。我认为您需要将故事导出到csv(在迭代中的“操作”下)并将其导入到新迭代中。下面是一个AppSDK2示例,它创建一个故事并将其安排到从迭代组合框中选择的迭代中Rally 是否有方法批量创建故事并将其分配给迭代?,rally,Rally,我们每个月都会这样做,并希望在未来的迭代中自动创建和安排故事。我们在几次Sprint之前就研究过这一点。我认为您需要将故事导出到csv(在迭代中的“操作”下)并将其导入到新迭代中。下面是一个AppSDK2示例,它创建一个故事并将其安排到从迭代组合框中选择的迭代中 <!DOCTYPE html> <html> <head> <title>Create Story</title> <script type="text
<!DOCTYPE html>
<html>
<head>
<title>Create Story</title>
<script type="text/javascript" src="/apps/2.0rc1/sdk.js"></script>
<script type="text/javascript">
Rally.onReady(function () {
Ext.define('CustomApp', {
extend: 'Rally.app.TimeboxScopedApp',
componentCls: 'app',
scopeType: 'iteration',
comboboxConfig: {
fieldLabel: 'Select an Iteration:',
labelWidth: 100,
width: 300
},
addContent: function() {
this._getIteration();
},
onScopeChange: function() {
this._getIteration();
},
_getIteration: function() {
var iteration = this.getContext().getTimeboxScope().record.get('_ref');
console.log('iteration',iteration);
if (!this.down('#b2')) {
var that = this;
var cb = Ext.create('Ext.Container', {
items: [
{
xtype : 'rallybutton',
text : 'create',
id: 'b2',
handler: function() {
that._getModel(iteration);
}
}
]
});
this.add(cb);
}
},
_getModel: function(iteration){
var that = this;
Rally.data.ModelFactory.getModel({
type: 'UserStory',
context: {
workspace: '/workspace/1111'
},
success: function(model) { //success on model retrieved
that._model = model;
var story = Ext.create(model, {
Name: 'story 777',
Description: 'created via appsdk2'
});
story.save({
callback: function(result, operation) {
if(operation.wasSuccessful()) {
console.log("_ref",result.get('_ref'), ' ', result.get('Name'));
that._record = result;
that._readAndUpdate(iteration);
}
else{
console.log("?");
}
}
});
}
});
},
_readAndUpdate:function(iteration){
var id = this._record.get('ObjectID');
console.log('OID', id);
this._model.load(id,{
fetch: ['Name', 'FormattedID', 'ScheduleState', 'Iteration'],
callback: function(record, operation){
console.log('ScheduleState prior to update:', record.get('ScheduleState'));
console.log('Iteration prior to update:', record.get('Iteration'));
record.set('ScheduleState','In-Progress');
record.set('Iteration', iteration);
record.save({
callback: function(record, operation) {
if(operation.wasSuccessful()) {
console.log('ScheduleState after update:', record.get('ScheduleState'));
console.log('Iteration after update:', record.get('Iteration'));
}
else{
console.log("?");
}
}
});
}
})
}
});
Rally.launchApp('CustomApp', {
name:"Create Story"
//parentRepos:""
});
});
</script>
<style type="text/css">
.app {
/* Add app styles here */
}
</style>
</head>
<body></body>
</html>
创造故事
Rally.onReady(函数(){
Ext.define('CustomApp'{
扩展:“Rally.app.TimeboxScopedApp”,
组件CLS:“应用程序”,
scopeType:'迭代',
comboboxConfig:{
fieldLabel:“选择迭代:”,
标签宽度:100,
宽度:300
},
addContent:function(){
这个;
},
onScopeChange:function(){
这个;
},
_getIteration:function(){
var iteration=this.getContext().getTimeboxScope().record.get(“'u ref');
log('iteration',iteration);
如果(!this.down('#b2')){
var=这个;
var cb=Ext.create('Ext.Container'{
项目:[
{
xtype:“拉力按钮”,
文本:“创建”,
id:'b2',
处理程序:函数(){
即:获取模型(迭代);
}
}
]
});
本条增补(cb);
}
},
_getModel:函数(迭代){
var=这个;
Rally.data.ModelFactory.getModel({
键入:“UserStory”,
背景:{
工作区:'/workspace/1111'
},
成功:函数(模型){//检索到的模型成功
那._model=model;
var story=Ext.create(模型{
名称:“故事777”,
描述:“通过appsdk2创建”
});
故事·拯救({
回调:函数(结果、操作){
if(operation.wasuccessful()){
console.log(“'u ref',result.get('u ref'),'',result.get('Name'));
记录=结果;
那._readAndUpdate(迭代);
}
否则{
控制台日志(“?”);
}
}
});
}
});
},
_readAndUpdate:函数(迭代){
var id=this.\u record.get('ObjectID');
console.log('OID',id);
此._模型负载(id{
获取:['Name','FormattedID','ScheduleState','Iteration'],
回调:函数(记录、操作){
console.log('ScheduleState-before-update:',record.get('ScheduleState');
console.log('update之前的迭代:',record.get('Iteration');
set('ScheduleState','In-Progress');
record.set('Iteration',Iteration);
记录。保存({
回调:函数(记录、操作){
if(operation.wasuccessful()){
console.log('ScheduleState after update:',record.get('ScheduleState');
console.log('更新后的迭代:',record.get('迭代');
}
否则{
控制台日志(“?”);
}
}
});
}
})
}
});
Rally.launchApp('CustomApp'{
名称:“创建故事”
//家长报告:“
});
});
.app{
/*在此处添加应用程序样式*/
}