Get a list of Sprints using YouTrack REST API - youtrack

I am creating a C# tool that pulls information from YouTrack using the REST API. I am looking for a way to get a list of the sprints that have been created. Is there a way to easily get this information through the REST API? Worst case I could get the list of issues and parse through all of them to collect all of the available sprints, but there has to be an easier way.

Version 5 changed the agile method. The new agile method is returned with the following command:
{baseUrl}/rest/agile/{agileID}/sprints
I had to get the list of the Agile ID's to use in the above url using the following command:
{baseUrl}/rest/agile/agiles
This now gives a list of all the agile boards and using the 'id' element in the first command above will return the list of sprints for that agile board. The AgileID's are returned something like 'myprojectname-99'. I found that if you just use the numeric number at the end of the ID, that will also work instead of using the full agile name.

I found a much simpler way to get the sprints:
{baseUrl}/rest/agile/{projectName}/sprints?"
This gives an XML with all of the sprints for that project and their start/end dates.

What you request can be obtained by GET {youtrac.base.url}/rest/admin/customfield/versionBundle/{bundleName}. To find out {bundleName}, go to agile settings and have a look at 'Field to identify sprints:' setting which gives you the field name. For this field, in Administration you can locate the name of the bundle.

{baseUrl}/rest/agile/{projectName}/sprints? is only working if the name of the agile board is the same as the projectName!!!
The API is: {baseUrl}/rest/agile/{agileName}/sprints?

Related

OpenAlex API - How to get institution ID?

I am trying to use the OpenAlex API: https://docs.openalex.org/api
This API provides access to a catalog of scholarly papers, authors, institutions, etc...
It is easy enough to make a query for an institution's information such. Here is an example from the API docs:
https://api.openalex.org/I19820366
I am trying to figure out how to get a specific institution's ID.
In the docs, there is a statement that this ID number is Microsoft Academic Graph's institutional ID: https://www.microsoft.com/en-us/research/project/microsoft-academic-graph/
But I have been unable to figure out anything in Microsoft Academic Graph either.
How can I find the institutional ID for a specific institution?
I am a beginner, and I also just started to retrieve data from the OpenAlex API. For me, the easiest way was either to use the ROR id or the GRID id, which you can both look up for any institution either here: https://www.grid.ac/ or here: https://ror.org/
Then you use either ROR or GRID-ID as an identifier (https://docs.openalex.org/about-the-data/institution#ids) and that identifier as a filter, as specified in the API documentation.
Be aware, that except for the Institution-ID, that you want to find, all the other institutional IDs, like ROR or GRID, have to be put in your request as a full URL. Take the example of the Johns Hopkins University. It's not enough to put their ROR like this: "00za53h95", you have to put in the API request like that: "https://ror.org/00za53h95" (without the quotes) or else it won't work. In my example, a request could look like this:
https://api.openalex.org/institutions/https://ror.org/00za53h95
This will deliver a nice json file with all the info you need, including the institution's ID in the database. Save the information as a file by using a cURL GET request or just do it via your browser and get the result as a webpage, both works. If you do the latter, you should follow the suggestion of the OpenAlex team and install a browser plugin like JSONVue, that will make the experience of reading the result on your screen so much better.
Hope that helps.
You can use the OpenAlex API to search for the ID like this:
https://api.openalex.org/institutions?filter=display_name.search:University%20of%20Virginia
In addition to Heather's comment, I'd like to add that we can now go to https://explore.openalex.org/ and search for any entity. Start typing "Johns Hopkins University" and you'll get to this page: https://explore.openalex.org/institutions/I145311948 which has all the identifiers (including the openalex id I145311948) and additional information about this institution.

Big Commerce API - Update Product Custom Field - 422 Error

I'm trying to build an integration for a client between Big Commerce and their ERP system. As part of this, I need to update existing custom fields against products in Big Commerce.
The API reference (https://developer.bigcommerce.com/api-reference/store-management/catalog/product-custom-fields/updatecustomfield) states that this is possible. I have built the integration code to use the exact method described in the API reference but it keeps returning a 422 error which says:
The custom field with the name: xxxxxxxxx & value: yyyyyy already exists.
I don't understand why it would give this error; I know it exists, that's why I'm updating it. If it didn't exist, I would be using the Create Custom Field method instead.
Anyone ever come across this issue before or know why this may be occurring?
Thanks in advance.
I've found the API to be fairly robust, and use the custom_field API a LOT.
Have you done a quick check, via the API to get ALL the custom_fields for the product you are trying to update the custom_field for, and make sure you are updating by the correct custom_field ID? (so, not trying to change a different custom_field, which will then cause this error to be raised?)

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 all the assignee for a particular project using JIRA Rest api?

I am developing an iOS application and i have search functionality where in users can search for issues by selecting fields like project , version , assignee and i have all the rest api's for other functionalities except for assignee , i tried to find but i didn't get any Api. i was using the below Api - /rest/api/2/user/assignable/multiProjectSearch?username&projectKeys&startAt&maxResults
and it doesn't give me the exact results , can anybody point me in the right direction like how can i get assignee's for a particular project when i select a project in the search field.
I guess that by assignees of the project you mean assigness from the issues that belong to the project. You can use search method:
https://docs.atlassian.com/jira/REST/latest/#d2e4863
/rest/api/2/search?jql=project=PROJ_KEY&fields=assignee
Please take into account "startAt", "maxResults" parameters and returned "total" value that are used to support pagination. You may need to check the jira.search.view.default.max property in your JIRA: https://confluence.atlassian.com/display/CLOUDKB/Changing+maxResults+Parameter+for+JIRA+REST+API

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

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