0

我们每个月都会这样做,并希望将故事的创建和调度自动化到未来的迭代中。

4

2 回答 2

0

我们在几个 sprint 前对此进行了研究。我相信您需要将故事导出到 csv(在迭代中的“操作”下)并将它们导入到新的迭代中。

于 2013-11-01T23:47:05.763 回答
0

这是一个 AppSDK2 示例,它创建一个故事并将其安排到从迭代组合框中选择的迭代。

<!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>
于 2013-11-01T23:48:50.373 回答