Rally: Pull stories counts by schedule state for a release? - rally

I'm trying to pull from the API of story counts for the latest release, broken down by schedule state. There's a report that does that currently, but I don't see any exposed method in the API. Does anyone know if that's possible to obtain?

You should be able to do a query for each schedule state, and grab TotalResultCount from the body of the response. For example:
https://rally1.rallydev.com/slm/webservice/1.31/hierarchicalrequirement.js?query=(ScheduleState = "Defined")
https://rally1.rallydev.com/slm/webservice/1.31/hierarchicalrequirement.js?query=(ScheduleState = "In-Progress")
and so on. Since there are only four "built-in" schedule states, plus an optional one before Defined and an optional one after Accepted, it's at most 6 requests.

You can further filter down Alan's examples above with some release information as well by changing the query parameter:
query=((ScheduleState = Defined) AND (Release.Name = "My Release"))
Are you writing an app using the App SDK or using one of our other REST toolkits (ruby, .net, python)? You may be able to find some better code examples here:
http://developer.rallydev.com

You might also try the Batch Query approach that allows you to just return the size of the query instead of counting the results. See the
"Getting the Size of a Collection" example of the api doc:
https://rally1.rallydev.com/slm/doc/webservice/batch.jsp#example8

Related

Relational Database: Best practice regarding amount of queries per API call

I am working with React Native/Redux and an express/postgresql backend.
I have an api call to create a comment that returns the created comment as well as some of the information concerning the user.
Those are two different api calls.
Now I also need the updated comment count to send to the feed reducer so that the count is still correct when they close the comment tab.
I was wondering if it is still okay to have 3 queries in one API call and maybe more general/meta, if there might be a better solution to this if that isn't the case.
Kind regards
It's perfectly fine to do multiple queries in a single API call. You can do as many as are required to complete a single coherent interaction between the server and client.

how to create version one burned down chart using java REST client api

I am trying to get the data to create the burned down chart from version one.
I came to know there is no standard api's for that.
Here i found that by making multiple call's to fetch todo value for a scope of timebox it is possible.
Is there any better way to do it?
and also let me know any good open source libraries(javascrpt/java) to plot such graph
i tried the way shown here but i am not able to make out what value i am getting.
i tried a get request like
"base URL"/rest-1.v1/Data/Timebox?where=State.Code='ACTV'&asof"11-25-2015"&sel=Name,EndDate,State,Workitems.ToDo.#Sum
but could only get present value but not the past ones.
Thanks in advance
You are using the rest-1.v1/Data endpoint. From this endpoint you will get the current state of assets in your VersionOne instance however, there is an attribute "Prior" which contains the previous state of a VersionOne asset (Timebox). The most robust way to access historical data is though the rest-1.v1/Hist endpoint. You can find details about Hist queries here.
Using your query
"base URL"/rest-1.v1/Hist/Timebox?where=State.Code='ACTV'&asof"2015-11-25T17:30:00.00"&sel=Name,EndDate,State,Workitems.ToDo.#Sum
The asof keyword will return the state of that Timebox at that instance in time. Observe the proper format of the date.

How to get reposted tracks from my activities?

Using the Souncloud API, I'd like to retrieve the reposted tracks from my activities. The /me/activities endpoint seems suited for this and I tried the different types provided.
However, I didn't find out how to get that data. Does anyone know?
Replace User Id, limit and offset with what you need:
https://api-v2.soundcloud.com/profile/soundcloud:users:41691970?limit=50&offset=0
You could try the following approach:
Get the users that shared a track via /tracks/{id}/shared-to/users endpoint.
Fetch the tracks postet by this user via /tracks endpoint, as the _user_id_ is contained.
Compare the tracks metadata with the one you originally posted.
I am not into the Soundcloud API, but taking a close look at it seems to make this approach at least as technical possible, though e.g. fetching all tracks won't be a production solution, of course. It's more a hint. Perhaps reposting means something totally different in this context.
And the specified entpoint exists in the general api doc, so I don't know if you would have to extend the java-api-wrapper for using it.

flickr API, getClusterPhotos with license filter

I am getting a collection of photos via this flickr API:
description: http://www.flickr.com/services/api/flickr.tags.getClusterPhotos.html
example: http://www.flickr.com/services/api/explore/flickr.tags.getClusterPhotos
I see no option to include the license parameter on the API query and I thus get copyrighted images returned, which I do not want. I see that I can get the license info by calling flickr.photos.getInfo on each individual image, but this will be quite time consuming. Are there any other methods to get a collection of photos from a tag cluster with a particular license?
License is one of the parameters listed in their api here:
http://www.flickr.com/services/api/flickr.photos.search.html
I would try just using the id's from the results listed here in their return:
http://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html
for example:
&license=4
It may be better to use "flickr.photos.search" instead. You can search for a specific tag and license (there is no need to do a second call on each image).
https://www.flickr.com/services/api/explore/flickr.photos.search

Google Analytics retrieve custom variables statistics

Edit refurbished the question that was not clear
New to GA, I'm looking at the way to retrieve automatically custom variables data statistics
The query would have
a start and an end dates (possibly equal)
a variable name
For instance, a Page-level variable Brand takes only three possible values, that are set by the web server, and seen by the client.
The values are Apple, Google and Microsoft.
The query to Google-Analytics could be something like (pseudo-code), provided that I use an authentication token previously acquired
...getstatistics?myToken=123&variable=Brand&datefrom=20110121&dateto=20110121
And the result could be some xml like data
<variable>Brand</variable><value>Apple</value><count>3214</count>
<variable>Brand</variable><value>Google</value><count>4321</count>
<variable>Brand</variable><value>Microsoft</value><count>1345</count>
Meaning for instance that the page-level custom variable Brand was set to the value Apple by the web server (and thus seen by the client / sent to GA) 3214 times.
What is the correct way/protocol to query values/statistics from GA, in order to get statistics related to custom variables?
So, this is my understanding of what you're doing:
You're setting page-level custom variables (important technical note: these need to be called before the _trackPageview or some other call, else they won't be tracked.)
Your code might looks something like this:
_gaq.push(['_setCustomVar', 2, 'Brand', 3]);
Now, when querying the Google Analytics API, its important to note that the slot # is very important, since the slot you're accessing is explicitly named in the query.
So, to do this, you'd need to set your dimensions to ga:customVarName2 and ga:customVarValue2, and decide what metric you're interesting it getting. You mention Page views, so you'd use ga:pageviews. (You're by no means limited to pageviews. You can use any Metric besides a couple of the AdWords specific ones.)
This query would return you all of the custom variable from this slot, and the number of pageviews associated with them.
You also mentioned you'd want to be able to filter by value.
You'd do that by setting the filter value to something like ga:customVarValue2==Apple.
You can see what a query like that would look like here in the query explorer.
Here's a sample screenshot:
Finally, all Google Analytics API queries by default require you to set a date range, so you could query that on your own.
All you need to do is decide which library you want to use as interface, and you're set to go.
Google has a handy resource, called the Google Analytics Data Explorer that can help answer a lot of your questions by letting you experiment through an interface, as long as you login with your Google Analytics credentials.
As you add parameters using their tools, the system will automatically build your URL/Query.
If that's not enough, Google also has some Interactive Examples using JavaScript. Like the Data Explorer, you can also login with your Google Analytics credentials and run the examples to see what data would be returned.
These tools are awesome because they help take the guesswork out of figuring out how to target the exact data you're searching for.