Bamboo Rest API multiple expands - api

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

Related

Bitbucket - Add default task when creating a pull requst

I am looking into improving the workflow my colleague and myself are using for BitBucket. Something that is often forgotten is the documentation for the feature we are working on therefore I thought I good way to 'don't forget' would be to add a Task as soon as a Pull request is created for a particular branch.
The first think a developer should do after creating the Pull Request would be:
- Add a comment, something like WIP (Work in Progress)
- Create a task underneath, something like 'Add documentation'
In this way, we won't be able to 'Merge' the branch into 'Develop' if All tasks are not completed (this is how it is currenly configured).
Rather than having the developer to do so, it would be good if we can have the system to do so as soon as we create the Pull Request.
Is that possible?
I had searchd on Internet, to be honest I didn't understand if taht functionality comes with like the Premium package or if it is an Add-On...who knows.
Thanks :)
Atlassian recently added a 'Default Pull Request Tasks' feature to Bitbucket Cloud.
The same functionality was previously available as a Bitbucket app, but it was removed in May 2020. It's now a native feature.
Product announcement: https://bitbucket.org/blog/bitbucket-cloud-product-updates-august-2022
Feature details: https://bitbucket.org/blog/default-pull-request-tasks
You can try this. It is free for 30 days.
https://marketplace.atlassian.com/apps/1225598/default-tasks-for-pull-requests?tab=pricing&hosting=datacenter
I did not find any free solutions.

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 does one list the changes via the API from a TeamCity build?

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.

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...