GitLab api: how am i able the get the list of projects using gitlab api? - api

i was trying to get the list of projects in my gitlab using Git api. for that i was following Git lab api instruction.
they said i can access the list of project by this link:
https://gitlab.com/api/v4/projects?access_token=some_token.
but unfortunately with the above link i got bunch of information, which is not mine at all. i got the information which is owned by other users.
In that case how am i able the get my own projects information?
Nevertheless, the respond JSON has so many attribute. is there anyway that i can achieve the attribute according to my desire?

You can use owned=true to get only project which you are owner and simple=true to have limited field, check this :
https://gitlab.com/api/v4/projects?access_token=some_token&owned=true&simple=true

Related

TODOIST API: How to get list of users to assign a specific user to task?

It seems that API allows to assign users to a task (called an Item in the API) using the body field responsible_uid at the add an item endpoint. However I cannot find a way to list user uids or any other way to get user details anywhere in API documentation.
Official python library todoist-python doesn't provide any way to do this either. So for now it seems I can only create tasks without assigning them to anybody, which is a bummer.
Any advise grately appreciated!
Links:
Todoist Sync API
Todoist
REST API
You should first share a project and then you can get all collaborators in the Sync request.

Is there a way to create a tracker using Tuleap API REST?

Tuleap API looks great:
https://demo.tuleap.org/api/explorer
I can find how to access projects, trackers, artifacts. I can see how to create new artifacts. But I find no way to create new trackers....
is there really no way to create a simple bug tracker from the REST API?
By November 2019, on the Tuleap's API Explorer, the operations' list regarding trackers doesn't show any method to add a tracker. The API methods available on this topic are:
Get tracker;
Partial update of a tracker;
Get all reports of a given tracker;
Get all artifacts of a given tracker;
Get all possible parent artifacts for a given tracker.

Create issue : Test link integration with jira

I've integrated Testlink with Jira using below xml
<issuetracker>
<username>xyz</username>
<password>#123</password>
<uribase>abc.net/projects/KEY/</uribase>
<uriapi>abc.net/rest/api/latest/</uriapi>
<uriview>abc.net/browse/</uriview>
<projectkey>KEY</projectkey>
<issuetype>1</issuetype>
</issuetracker>
I am able to link existing jira issue in to test link.
But create issue window contains Version field which would not alow me to enter any value or not giving any suggestion as displayed in below image.
I've tried to create version in jira but it doesn't work.
So,
What value i should enter/configure for version field ?
What is use of <issuetype>1</issuetype> ? can we provide any other value?
How to link new field on create Issue window?
4.Version is mismatched with jira field Versions.
I'm not sure which version of JIRA REST API you are using but the tutorial for the v2 says:
Just like everyone else in the real world, we're faced with time and resource constraints. Supporting two serialisation formats requires more time than just a single one. Hence, for our initial release of the JIRA REST API, we decided to provide "more stuff in JSON" rather than "less stuff in JSON and XML".
So I'm not sure about the XML support. I have no experience with Testlink, but I guess it's using some kind of serialiser at the back end.
If you check the Create issue endpoint, there is no version field. I guess it will be the versions field instead. In JIRA projects can have multiple versions. You can get a list of versions from the Get project eversions endpoint.
Issue type is an ID of issue type you want to use for your issue. You can get a list of project specific issue types from the Get issue all types
endpoint.
I'm not sure about this
Check the first point
This version field is empty because you have not specified any version for your project in JIRA. In my case it was Fix version in JIRA. Currently the rest API is getting an empty list of versions. You can try
curl -X GET http://example.com/rest/api/2/project/KEY/versions
-H 'authorization: Basic dtgzkisVlbyhsuYWhtYijdsdidjjsidDkw'
This will give you an empty list.
Once you set FixVersion in for your project in JIRA, this API will return the list of available versions for your project and the Version field will be populated with those versions.
PS: use your own authorization headers. You can use [Postman][1] for this purpose.

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.