Rally Software

 View Only
  • 1.  Rally API - Using Fetch on query for User Stories

    Posted Jun 26, 2020 02:30 PM
    I have 2 workflows in a third-party application that generate results from a Rally query - one works, the other does not. (Essentially I'm creating a defect or user story and then returning the ID back to the application as a cross-reference field)

    Working - Defect Query:
    I build a query string that looks like this: defect?query=(Name%20contains%20{token})&fetch=FormattedID
    The token variable is assigned, and the query sent out. The result is stored in a variable, and I get the FormattedID. (DE3203)

    Not Working - User Story Query:
    I copied the same action and changed the query string to this: hierarchicalrequirement?query=(Name%20contains%20{token})&fetch=FormattedID
    The result is stored back in the variable, but in this case, I end up with the first 6 characters of the entire result: {QueryResult":{_rallyAPIMajor........
    The result shows that it found the UserStory, and it shows the correct Formatted ID in the result, it's just not stripping away everything but the FormattedID. 

    I'm not sure what the difference is, unless maybe the User Story FormattedID or Fetch is handled differently? Any thoughts would be appreciated.

    ------------------------------
    - Keith Jones
    - MCIC Vermont
    ------------------------------


  • 2.  RE: Rally API - Using Fetch on query for User Stories

    Broadcom Employee
    Posted Jun 26, 2020 02:56 PM
    Hi Keith,

    Both your filters look good and same. You mentioned these results go into a 3rd party application. I would guess the 3rd party application may not be reading/parsing the returned JSON in the same way, perhaps there's some glitch in that code in the case of a user story (hierarchicalrequirement).

    My first suggestion - make sure the JSON that Rally returns does look good as you expect. It sounds as if you already did that and confirmed. If that is indeed the case then it should indicate that Rally (server side) is good.

    Then, you shall look at your code, preferably debug it and inspect how Rally's returned JSON is being parsed and set into your variables.

    If you'd like to share your code, we can have a look as well.

    I hope this helps.
    Sagi


  • 3.  RE: Rally API - Using Fetch on query for User Stories
    Best Answer

    Posted Jun 26, 2020 03:43 PM
    Sagi,

    Thanks again for the help. Not sure what it was, but I went back and re-typed the code that formatted the result (trimming before and after the FormattedID part of the result). That seemed to do it. It was probably some misplaced space, comma, or just aliens. Anyway, it's all up and running. Thanks!

    ------------------------------
    - Keith Jones
    - MCIC Vermont
    ------------------------------



  • 4.  RE: Rally API - Using Fetch on query for User Stories

    Broadcom Employee
    Posted Jun 26, 2020 04:11 PM
    :)

    Probably the aliens. You never know when they're around ... :)

    Glad it's working.

    Take care,
    Sagi