Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Fetch Reference Object values from actual JSON response of tRestClient for Rally API

Hi All,

 

I am trying to fetch Reference Object values (_ref) from actual JSON response using tRestClient for Rally API. Need help

 

tRestClient:

URL: https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature/**********?fetch=UserStories

 

JSON Response is:

{
"Feature": 
{
"_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature/************", 
"_refObjectUUID": "*******-****-****-***-*******", 
"FormattedID": "F9999", 
"_refObjectName": "Feature Name", 
"UserStories": 
{"_rallyAPIMajor": "2", 
"_rallyAPIMinor": "0", 
"_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/PortfolioItem/Feature/************/UserStories", 
"_type": "HierarchicalRequirement", 
"Count": 2}, 
}
}

 

My Reference URL Feature.UserStories._ref (_ref) https://rally1.rallydev.com/slm/webservice/v2.0/PortfolioItem/Feature/************/UserStories returns below JSON:

{"QueryResult": {

"TotalResultCount": 2, 
"StartIndex": 1, 
"PageSize": 20, 
"Results": [ 
{
"Expedite": false, 
"FormattedID": "US1234", 
.....
}
{
"Expedite": false, 
"FormattedID": "US5678", 
.....
}
}}

 

My question is, how to fetch the values available in the Reference Object --> Feature.UserStories._ref into my actual reponse

Expected O/p:

{
"Feature": 
{
"_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature/************", 
"_refObjectUUID": "*******-****-****-***-*******", 
"FormattedID": "F9999", 
"_refObjectName": "Feature Name", 
"UserStories": 
{
 "FormattedID": "US1234", 
 "FormattedID": "US5678"
}
}
}

I want to understand, how to pass the inputs/conditions to frame the URL (tRestClient) 

 

Labels (5)
5 Replies
Anonymous
Not applicable
Author

@rhall : As usual, I expect your response to my new post too 0683p000009MACn.png

Please consider with priority. 

 

Also I wish to understand how to handle pagination for Rally API. 

Is this the only way ?

Use ?start=1&pagesize=200 to fetch initial 200 records

Use ?start=201&pagesize=200 to fetch next 200 records

Anonymous
Not applicable
Author

You would need to use the tExtractJSONFields component and make use of JSONPath to get this data. The data you want appears to be in an array so you would need to loop on that array. There are lots of descriptions on how to use JSONPath with the tExtractJSONFields component on here.

 

Regarding the pagination, you will need to use a tLoop for this. I describe a way of doing this here.

Anonymous
Not applicable
Author

Thank you for the response.

But if I use tExtractJson, I can fetch the url as userstories._ref but not
the values from the url. Now I need all FormattedID's under userstories url.
Can I achieve that using tExtractJson. If yes, kindly suggest how ?
Anonymous
Not applicable
Author

Sorry, I misunderstood. Just save the ref url to a globalMap variable (use the tFlowToIterate to do this), then use that globalMap value as the URL for another tRestClient.

Anonymous
Not applicable
Author

Sure... Thank you for the reply

I expected a workaround where I can pass few parameters in parent URL and
fetch the values from reference object.

Will design the code accordingly