Rally App2.0 - 检索特定故事 [英] Rally App2.0 - Retrieve a specific story

查看:64
本文介绍了Rally App2.0 - 检索特定故事的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我掌握了 2.0 的窍门,但在一些看起来很简单的事情上有点卡住了.

I am getting the hang of 2.0, but a bit stuck on something that seems simple.

基本上,我已经为我的团队创建了一个新的应用程序(感谢大家的帮助).我认为有一种方法可以向仪表板添加消息会很酷.

Basically, I have created a new app for my team to use (thanks all for the help). I thought it would be cool to have a way I could add messages to the dashboard.

我决定实现这一目标的最简单方法是创建一个故事,然后在我的代码中简单地查询该故事、获取描述并将其显示在应用程序中.听起来很简单吧?

I decided the easiest way to accomplish this, is to create a story and in my code simply query that one story, grab the description and show it in the app. Sounds easy enough right?

我有一些时间简单地用完抓取描述字段并显示它.我知道这听起来很奇怪,但看起来很复杂.我试过这种方式

I am having a bit of a time simple running out grabbing the Description field and showing it. I know it sounds odd, but it seems so complicated. I have tried this way

            showMessage: function (message) {
                debugger;
                this.add({
                    xtype: 'label',
                    html: message
                });
            },

            getMessage: function () {
                var defectStore = Ext.create('Rally.data.WsapiDataStore', {
                    model: 'UserStory',
                    fetch: ['Description'],
                    filters: [{
                        property: 'FormattedID',
                        operator: '=',
                        value: 'US13258'
                    }],
                    autoLoad: true,
                    listeners: {
                        load: function (store, records) {
                            debugger;
                            if (records)
                                return records[0].get("Description");
                        }
                    }
                });
            },

但似乎陷入了事件意大利面.当然有更简单的方法:)

But seems to get caught up in event spaghetti. Surely there is an easier way :)

只想去抓取一个特定的故事描述字段...

Just want to go grab a specific stories description field...

推荐答案

您可以使用模型的加载方法来做到这一点:

You can use a model's load method to do this:

var storyOid = 12345;

//Get the story model
Rally.data.ModelFactory.getModel({
    type: 'UserStory',
    success: function(model) {

        //Load the specific story
        model.load(storyOid, {
            fetch: ['Description']
            success: function(record) {

                //success!
                var description = record.get('Description');
            }
        });
    }
});

这篇关于Rally App2.0 - 检索特定故事的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆