Rally Software

 View Only
  • 1.  Curl command with "query" parameters fails

    Posted Jun 24, 2020 11:22 PM
    If I try to include the "query" parameter in a curl command to the web services it fails.  The same URL without the query parameter works.

    This works:
    curl --header "zsessionid:_abc123" -H "Content-Type: application/json" https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/bi?project=https://rally1.rallydev.com/slm/webservice/v2.0/project/30774269735&fetch=true&order=FormattedID&start=1&pagesize=2000

    This does not (difference in the two commands is highlighted):
    curl --header "zsessionid:_abc123" -H "Content-Type: application/json" https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/bi?project=https://rally1.rallydev.com/slm/webservice/v2.0/project/30774269735&query=((State != "Done") and (State != "Value Delivered"))&fetch=true&order=FormattedID&start=1&pagesize=2000

    Any help would be appreciated.

    ------------------------------
    Steve
    ------------------------------


  • 2.  RE: Curl command with "query" parameters fails

    Broadcom Employee
    Posted Jun 25, 2020 07:07 AM
    Shouldn't that statement start "?query=" and not "&query=" ?

    ------------------------------
    Nik
    Ask me a question, I'm All Ears!
    Rally Sales Engineer
    Rally Software
    ------------------------------



  • 3.  RE: Curl command with "query" parameters fails
    Best Answer

    Posted Jun 25, 2020 09:08 AM
    So I figured it out.  The curl command does not like brackets etc.  If you "escape" them it works as expected.  Command below works.

    curl --header "zsessionid:_abc123" -H "Content-Type: application/json" https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/bi?project=https://rally1.rallydev.com/slm/webservice/v2.0/project/30774269735&query=\(\(State != "Done"\) and \(State != "Value Delivered"\)\)&fetch=true&order=FormattedID&start=1&pagesize=2000


  • 4.  RE: Curl command with "query" parameters fails

    Broadcom Employee
    Posted Jun 25, 2020 09:18 AM
    That's good, because it looks like I didn't read the whole line! I just assumed the project/30774269735 bit was the end of the URL, not the project ref. Doh!

    ------------------------------
    Nik
    Ask me a question, I'm All Ears!
    Rally Sales Engineer
    Rally Software
    ------------------------------