Rally Software

 View Only
  • 1.  Trying to get revisions by a specific user, and walk back to the artifact that the revision is for

    Posted Jul 03, 2019 08:42 AM
    0

    I can query the Revisions to get the last N revisions of a specific user, but the RevisionHistory / RevisionNumber that comes back with the recordset is not traceable to the artifact (feature, US, defect) that it is a revision of. The RevisionHistory includes Subscription, Workspace and Revisions - not enough to continue tracing to the artifact.

    Not looking for any code, just a pointer on how to spelunk the object model to get enough information to render a FormattedID (F1234, US1234, DE1234).

    My first starting point is always the object model at https://rally1.rallydev.com/slm/doc/webservice/



    ------------------------------
    Benefitfocus.com, Inc
    ------------------------------


  • 2.  RE: Trying to get revisions by a specific user, and walk back to the artifact that the revision is for

    Posted Jul 03, 2019 11:37 AM
    There is probably an easier way, but I do something similar using the Excel plug-in. Download the relevant data and then populate the defect number using Vlookup.


  • 3.  RE: Trying to get revisions by a specific user, and walk back to the artifact that the revision is for

    Posted Jul 03, 2019 01:24 PM
    Thanks, was hoping for a more general solution as I'd like to do this for all work items (features, stories, defects, ...) at some point.

    The genesis of this was from a couple of apps that I wrote to display Posts that each user made, and Posts that reference yourself. Users love them and wanted to similarly see the changes that they made in reverse chronological order - so this is something that unfortunately really needs to be an app, and not something each user would have to extract and manipulate.

    ------------------------------
    Benefitfocus.com, Inc
    ------------------------------



  • 4.  RE: Trying to get revisions by a specific user, and walk back to the artifact that the revision is for
    Best Answer

    Broadcom Employee
    Posted Jul 03, 2019 02:12 PM
    Hi Greg.

    If I understand your question, you're trying to put together a list of artifacts changed by a specific user (perhaps within a given time frame). Is that correct?

    WSAPI is unable to help unfortunately. But LookBack API can.

    WSAPI - Web Services API - will not allow querying for the revision history of artifacts. In that page you had mentioned for object model, if you click on 'Artifact' and scroll down to the RevisionHistory field you shall see that it can not be used in queries.  You can query for revisions based on users like you said from the Revision endpoint, but you can't tie them up to artifacts cause you'll need to run a query on the Artifact endpoint which is blocked.

    However, this requirement should be fairly simple to the Lookback API. The Lookback API stores history of changes to artifacts in forms of snapshots. There are some limitations such as, it won't record snapshots for changes for Attachments, or any of the Rich Text Fields (such as Description, Discussion, Notes). You can use this api to find snapshots of changes based on the user who initiated them, based on time frames and other criteria. The snapshots you will get with your queries will also have the Revision field that will match the revision you're finding in WSAPI. However, going back to your request, it doesn't sound as if you really care for the revision numbers, but do care for the artifacts, the dates and the user. In that case you can form that query to the lookback api and not even worry about the revisions at all.

    Here is a sample query that comes close to what you need:
    https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/<<Your Workspace OID>>/artifact/snapshot/query.js?find={"_User":<<User OID>>,"_ValidFrom":{"$gte":"2019-07-01T00:00:00.000Z"}}&fields=["FormattedID","Name","Owner","_ValidFrom","_ValidTo","_PreviousValues","_RevisionNumber"]&pagesize=2000

    The above query shall return all snapshots of changes made by the user (fill in the <<User OID>>) after 07.01.2019. You can further constrain this query to only look at Defects or other artifact types, perhaps based it on previous values of some of your fields etc etc...

    If you need a more specific query sample, let us know and we'll try to have it for you.

    I hope this helps. 
    Sagi


  • 5.  RE: Trying to get revisions by a specific user, and walk back to the artifact that the revision is for

    Posted Jul 09, 2019 04:13 PM
    This is much closer than I've been.

    The URI returns most of the information, except the Description of the revision/change. I tried fiddling with query string to no avail.

    The second problem is that I've tried adapting the code at:
    https://stackoverflow.com/questions/17756124/rally-lookback-call-in-custome-html-app
    which is a nice debugging app to try different values, fields and so forth, without making code changes. The problem this app was that the URI is encoded and the server can't return a response.

    I know that I originally didn't ask for any code, but if you can point me to other HTML app samples that use the lookback API, I think I can take it from there.

    ------------------------------
    Benefitfocus.com, Inc
    ------------------------------



  • 6.  RE: Trying to get revisions by a specific user, and walk back to the artifact that the revision is for

    Broadcom Employee
    Posted Jul 09, 2019 06:19 PM
    Hi Greg.
    Glad you're much closer. 

    To answer your questions:
    - The revision description isn't captured as part of the snapshots and isn't available using the lookback api. The revision-related information that's captured in the snapshots and is available includes the revision OID, the revision date and timestamp and revision number. You can see a full list of the additional fields in this page: LookBack API Page . Check out the 'Additional Available Fields' section.
    Here's a screenshot of what it looks like from what can be returned via the lookback api.



    If you need the revision's description field then you'll need to make a WSAPI call to the 'revision' endpoint with a filter such as: (ObjectID = <revision>)  so, for example: (ObjectID = 298636462652) , then you shall be able to fetch the description.

    Just to be sure, I'll highlight that WSAPI and LBAPI query two separate repositories. WSAPI is querying the Rally repository, while LBAPI queries an analytics repository. 

    - As far as LBAPI apps:  I am not familiar with apps for LBAPI, the one I'm aware of in-fact the one you shared. There can not be many apps cause after all it's a read-only analytics repository that only has snapshots. Probably better than even the app you found is https://rally1.rallydev.com/analytics/doc/#/tryitnow . This page allows you to select your workspace, specify a few arguments at the top and then fill in your filters and click 'Try it' to get results. It also provides a few sample filters. 


    I hope this helps.
    Sagi