Search code examples
extjsextjs4rally

Uncaught Rally.data.ModelFactory.getModel(): Could not find registered factory for type: milestone


Trying to display Milestone for each release, but when trying to create DataStore for Milestone getting error Uncaught Rally.data.ModelFactory.getModel(): Could not find registered factory for type: milestone below is my code any ideas or suggestions on this

            _getMileStones: function(startDate, endDate, project_id) {
                var startDateFilter = Ext.create('Rally.data.QueryFilter', {
                    property: 'TargetDate',
                    operator: '>',
                    value: startDate
                });
                startDateFilter = startDateFilter.and({
                    property: 'TargetDate',
                    operator: '<',
                    value: endDate
                });
                startDateFilter = startDateFilter.and({
                    property: 'TargetDate',
                    operator: '!=',
                    value: null
                });
                startDateFilter = startDateFilter.and({
                    property: 'TargetDate',
                    operator: '!=',
                    value: null
                });
                var filters = startDateFilter;
                Ext.create('Rally.data.wsapi.Store',{
                    model: 'milestone',
                    autoLoad: true,
                    filters: filters,
                    context: {
                        project: project_id,
                        projectScopeDown: true,
                        projectScopeUp: false
                    },                          
                    fetch: ['Name','FormattedID','DisplayColor'],
                    listeners: {
                        load: function(store,records) {
                            console.log("records values", records);
                        }
                    }       
                }, this);   
            },

Solution

  • The current stable rc3 release candidate of AppSDK2 predates milestones. They are not available in rc3. When I use rc3 I get the same error you get. If I switch to "x", in the app's config file, and use rab build to rebuild the app, the error goes away:

    {
       "name": "myapp",
       "className": "CustomApp",
       "server": "https://rally1.rallydev.com",
       "sdk": "x",
       "javascript": [
          "App.js"
       ],
       "css": [
          "app.css"
       ]
    }
    

    Generally it is not recommend using "x" because it is constantly changes. It is not a stable version. But as long as you know that, you may use "x". The AppSDK next release may not be too far in the future, and it will include support for Milestones.

    UPDATE: AppSDK2.0 GA has not been announced yet, but it is expected to be released soon. If you use "sdk":"2.0" you get Milestone data.

    "x" returns Milestones, but it is a head version that is subject to constant changes. 2.0rc3 does not have Milestones.

    You may choose to use 2.0 even though it is not formally available yet.

    This app example:

    Ext.define('CustomApp', {
        extend: 'Rally.app.App',
        componentCls: 'app',
        launch: function() {
            Ext.create('Rally.data.wsapi.Store',{
                model: 'milestone',
                autoLoad: true,                         
                fetch: ['Name'],
                listeners: {
                    load: function(store,records) {
                        console.log("records values", records);
                    }
                }       
            }, this);  
        }
    });
    

    Along with this config:

    {
       "name": "milestones",
       "className": "CustomApp",
       "server": "https://rally1.rallydev.com",
       "sdk": "2.0",
       "javascript": [
          "App.js"
       ],
       "css": [
          "app.css"
       ]
    }
    

    will return milestone data:

    enter image description here