Rally Software

 View Only
Expand all | Collapse all

Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

  • 1.  Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Posted Jan 07, 2020 12:33 PM
    Edited by Gregory Garcia Jan 07, 2020 07:30 PM


    Title error:
     How to retrieved the rank of a story feature using the SnapshotStore


    Using Javascript, I'm querying the Rally SDK 2 Lookback API to get information on my stories at a past date (2019-10-28). I run a query (described below) to retrieve some features according to their identifier and it works pretty well.

    My problem is that the rank values are never populated in the response, whereas the other values (like FormattedId or Name) are well retrieved... The retrieved value is always empty. According to the documentation, number values should be retrievable from snapshots. Moreover, within Rally, I can see the Rank value history of a feature:

    Would someone have an idea on how to retrieve a feature rank using the lookback API, please?

    var features = Ext.create('Rally.data.lookback.SnapshotStore', {
            fetch: ['Rank', 'FormattedID','Name'],
            context: {
                workspace: ['...'], // I prefer not to publish my real value
                project: ['...'] // I prefer not to publish my real value
            },
            filters: [
                {
                    property: '__At',
                    value: '2019-10-28T19:32:00Z'
                }, {
                    property: 'ObjectID',
                    operator: '=',
                    value: 328553426396 // feature identifier to be retrieved
                }
            ],
            listeners: {
                load: loadedFeatures,
                scope: this
            },
        });
    features.load();
    function loadedFeatures(store, features) {
        console.log(' - ' + (features? feature.length : 0) + ' features retrieved...');
        _.each(features, function (feature) {
            console.log(feature);
        }
    }

    PS: I confirm that the feature had a rank value at this date :)



  • 2.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Broadcom Employee
    Posted Jan 07, 2020 12:43 PM
    Hi Gregory,

    You may want to fetch DragAndDropRank rather than Rank. The fields that you can fetch on artefacts are listed in the WSAPI docs for your system. They are dynamically generated.

    If you go to https://rally1.rallydev.com/slm/doc/webservice/ and then go down to the HierarchicalRequirement (which is the name for User Stories), it will list the fields that are normally held. Just bear in mind that the LBAPI does not track all the fields, e.g. not RTF fields like the Description or Notes.

    ------------------------------
    Nik
    Rally Sales Engineer
    Rally Software
    ------------------------------



  • 3.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Posted Jan 07, 2020 12:52 PM
    Thanks for your message an your so quick response Nik.

    I made a mistake, I'm working with features and not with stories. I'll edit the original message.

    I already tried the DragAndDropRank but I get same results as Rank, that's to say nothing.


  • 4.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Broadcom Employee
    Posted Jan 07, 2020 12:59 PM
    Edited by Nik Antonelli Jan 07, 2020 01:05 PM
    I think you might need to add a 'fetch' line to the lookback store load. I don't think DragAndDropRank is one of the defaults fetched. Have a look at the example in the docs:  https://rally1.rallydev.com/docs/en-us/saas/apps/2.1/doc/index.html#!/api/Rally.data.lookback.SnapshotStore

    ------------------------------
    Nik
    Rally Sales Engineer
    Rally Software
    ------------------------------



  • 5.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Posted Jan 07, 2020 01:10 PM
    Thanks again for your suggestion Nik. 

    The DragAndDrop value is not retrieved for my features, even if fetched. As no ID is retrieved, it cannot be hydrated too.
    fetch: ['DragAndDropRank', 'Rank', 'FormattedID', '_ValidFrom', '_ValidTo'],
    hydrate: ['DragAndDropRank', 'Rank'],



  • 6.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Broadcom Employee
    Posted Jan 07, 2020 01:14 PM
    Hmmm.... it works for me....

    I used this app: https://github.com/nikantonelli/LBAPI-Query


    ------------------------------
    Nik
    Rally Sales Engineer
    Rally Software
    ------------------------------



  • 7.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Posted Jan 07, 2020 01:16 PM
    Thanks for this suggestion Nik, I don't know this tool, I will investigate further with it! I'll keep you in touch.


  • 8.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Posted Jan 07, 2020 07:49 PM
    Edited by Gregory Garcia Jan 07, 2020 07:52 PM
    I tried the tool you mentioned but it returns me no value for the Rank and the DragAndDropRank properties of my feature:

    Even if I ask for current values, I get nothing whereas the current Rank value is 0.400:



    If I set Rank value to 5 in the feature, and if I try again to get current value, I still get nothing.



  • 9.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Broadcom Employee
    Posted Jan 08, 2020 05:17 AM
    Hi Gregory,

    I have never seen a 'Rank" field as a standard field as I have ever only worked in workspaces that have the Ranking Method set to DragAndDrop rather than manual.

    You are the first and only, in the six years of working with different customers!

    I suspect that the LBAPI does not read the Rank field because of the way it is written. The fact that you have ranking set to manual means that you don't have any values in the DragAndDropRank field either.

    I don't think you are going to be able to get access to any ranking information through LBAPI unless you switch on DragAndDrop ranking - which is our recommended way when first setting up. I don't know what impact that will have on your organisation if you have been using it in maunal mode for a while.

    The WSAPI should give you the rank field on request, but that is only the instantaneous state of the field right when you ask for it.


    ------------------------------
    Nik
    Rally Sales Engineer
    Rally Software
    ------------------------------



  • 10.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Posted Jan 08, 2020 06:06 AM
    Thanks for this clarification Nik!
    I confirm that I can retrieve the current Rank value with the WSAPI.

    I will check internally if we can switch to DragAndDropRank.


  • 11.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore
    Best Answer

    Posted Jan 08, 2020 06:30 AM
    Edited by Christopher Hackett Jan 10, 2020 02:50 PM
    I just got an idea... Rally displays the feature revision history. In this revision  history, I can see the Rank value changes. So, if I can retrieve this history thanks to the WSAPI, then I should be able to extract the Rank values changes and to retrieve the value at a given date...


  • 12.  RE: Rally SDK2 Lookback API - Javascript - How to retrieved the rank of a story using the SnapshotStore

    Posted Jan 13, 2020 08:06 AM
    Edited by Gregory Garcia Jan 13, 2020 08:07 AM
    I confirm this approach works well, except for deleted features. The deleted features do not have their revision history reference anymore, as explained in the topic named [Rally SDK2 WSAPI - Javascript - How to retrieve the revision history of a deleted feature?].