How does one list the changes via the API from a TeamCity build? - api

I'm trying to find a way to get all the comments from a particular build in TeamCity via the Rest API. How can one do that?

http://teamcity:port/httpAuth/app/rest/changes?locator=build:(id:77651)&fields=count,change:(version,username,date,href,comment,files)
Via this URL, one can list out in custom fashion exactly the fields they wish to return. I don't think this is documented, i got this from their support folks. Enjoy!
PS - There are other examples out there which iterate over each change, this lists out all the changes for a particular build id in one place, for parsing.

Related

how to set allowed values through Rally WSAPI?

How can one set the allowed values for a Rally attribute (e.g. "Package") using Rally's web services API (2.0)?
I know how to retrieve the allowed values, and the WSAPI documentation says one should be able to POST new ones, or PUT to existing ones to rename them. But in actuality, POSTing new ones returns an error saying that POST isn't supported, and PUTting to existing ones isn't possible because they don't have _refs to PUT to.
Clearly there must be some way to do this — after all, the GUI can do it — but I haven't managed to figure it out. Anyone have the answer?
Ah, the package field... 'Twas a simpler time when this field was created. Unfortunately it is implemented differently than almost all other dropdowns in Rally and as such is not able to be updated via WSAPI as you have found. Other field allowed values (including custom fields) have _refs and operate as you expect above.

Bamboo Rest API multiple expands

Tried to fetch information for multiple builds from bamboo using the rest api. The information for the builds should include the ticket names the builds affacted and the commit messages for the commits which are included in these builds.
My Approch was the following:
{bambooUrl}/rest/api/latest/result/{projectkey}-{buildKey}.json?expand=results.result.vcsRevisions
{bambooUrl}/rest/api/latest/result/{projectkey}-{buildKey}.json?expand=results.result.jiraIssues
Both of these calls work fine but I need them merged together in one call:
I have tried the following:
{bambooUrl}/rest/api/latest/result/{projectkey}-{buildKey}.json?expand=results.result.jiraIssues,results.result.vcsRevisions
But this call just expands the vcsRevisions for me. Does someone have an tip for me how to use multiple expands?
I might be too late to answer your question, but solution might help others.
{bambooUrl}/rest/api/latest/result/{projectkey}-{buildKey}.json?expand=jiraIssues,vcsRevisions
worked for me

How can I retrieve a Gitlab Project tag list through the API?

I'm writing a REST client to look at project information available from several gitlab servers at the same time in one consolidated place. I understand REST and am able to pull the project details I need except one: the tags.
I'm not talking about git repository tags, those I'm able to get to just fine. I'm referring to the tags that are set under Project Settings. These are tags that, from what i can tell, are meant to be a form of describing the project, not referencing a particular commit hash.
I submitted a merge request back to the Gitlab folks, if accept, any REST call that involves a Project class will include a "tag_list" field with all the project labels.
The merge request is available here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/329
EDIT: This was merged in Gitlab version 7.10.0 so now you can just run a GET on the Project and the tag_list will be included with the JSON response.
Try this:
http://www.example.com.br/api/v3/projects/#{str}/repository/tags?private_token=yourtoken"
Note that in #{str} variable, if you using a group/repository structure, you must replace the dash to %2F, for example, you must set:
http://www.example.com.br/api/v3/projects/group%2Frepository/repository/tags?private_token=yourtoken"
The response to your request will be the body. So you can console log response.body to retrieve the tags.
Not possible: ACCEPTING MERGE REQUEST at: http://feedback.gitlab.com/forums/176466-general/suggestions/6325819-project-labels-via-api , so feel free to implement it if you need it.
Should be simple: just return the project.tag_list (see: https://github.com/mbleigh/acts-as-taggable-on) as a JSON list from https://github.com/gitlabhq/gitlabhq/blob/41518a467dcef61deca24ad2f6205c6fd5706e1b/lib/api/projects.rb#L60
Always check the request tracker first for features ;) True, in this case you may have done it an not found because of label vs tag keyword confusion, I think it was renamed at some point, so always search for both.

How to check mergeability of a branches using the github api

I'm trying to check if branch can be merged to another using the github API. There is a property mergeable in GET /repos/:owner/:repo/pulls/:number, but I don't actually want to create a pull request before I know that branches can be merged w/o conflicts.
On the github website, when creating a pull request, there is a call to this address which doesn't seem to be an API method (it returns HTML saying whether branches can be merged or not).
But still I could use this call, the problem is I have no clue what '1373893022922' refers to. I'd suggest it's somehow connected to the base branch (newdev3 is head).
Any ideas?
There's now a mergeable property in the PR response.
There's no easy way (it seems) to do this. Your best bet is to attempt to merge the two branches using the Merging API but that would result in a merge if in fact the two branches are mergeable. I suspect that's not what you're looking for.
You could also clone the repository and just those two branches and refer to some other questions here on StackOverflow that address whether two branches are fast-forwardable. That may be a more reliable way of determining this.

Asana API for Projects Assigned to Me

For Tasks assigned to me, I see how I can do
curl -u <api_key>: "https://app.asana.com/api/1.0/tasks?workspace=14916&assignee=me"
I am trying to make a quick page that breaks down my current tasks and links to Asana for me, so I can have my own quick dashboard.
I have my API Key
It lists all Workspaces I am a part of.
If I click a Workspace it shows all Projects inside of that space
If I click a Project I want to see only the Tasks that have been assigned to me inside of that Project.
If I add the Project ID to that above call, it sends me back every item in the Project, not just those assigned to me.
If I leave the Project ID out, it returns all tasks assigned to me, even those outside of the project.
Did I miss something?
Thanks for any help!
Note: I would add the Asana tag, but it doesn't appear to exist yet.
It seems that in the current version of the API the assignee parameter is ignored when specified for projects. Regardless of what I put below, I get the same result: all tasks.
curl -u <api-key>: "https://app.asana.com/api/1.0/projects/<pid>/tasks?assignee=here-it-can-be-anything"
I'm having trouble with this too - it seems you can't expand projects when querying tasks - and you can't get tasks by project... The former is actually preferred since you could provide a task list by project if you could expand on project.
As it is, you can get a list of tasks, then loop through and get the full task by task-id, but that takes a while...