Skip to main content

project_timelogs

Gets or lists a project_timelogs resource.

Overview​

Nameproject_timelogs
TypeResource
Idgitlab.projects.project_timelogs

Fields​

The following fields are returned by SELECT queries:

GraphQL response envelope

NameDatatypeDescription
idstringInternal ID of the timelog.
projectobjectProject identity (id, full_path, name)
spent_atstringTimestamp of when the time tracked was spent at.
summarystringSummary of how the time was spent.
time_spentintegerTime spent displayed in seconds.
userobjectUserCore identity (id, username, name)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectfull_path, hostend_date, end_time, group_id, project_id, sort, start_date, start_time, usernameTime logged on issues and merge requests in the project. Generated from the GitLab GraphQL schema field Project.timelogs (connection of Timelog nodes).

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
full_pathstringFull path of the project, for example gitlab-org/gitlab
hoststringGitLab host, with an optional port (default gitlab.com). Resolved from the GITLAB_HOST environment variable when it is set (x-stackQL-envVar); a WHERE host value always takes precedence. Self-managed instances: the provider is generated from the gitlab.com schema, so older instances may reject fields they do not serve. (default: gitlab.com, x-stackQL-envVar: GITLAB_HOST)
end_datestringList timelogs within a date range where the logged date is equal to or before endDate.
end_timestringList timelogs within a time range where the logged time is equal to or before endTime.
group_idstringList timelogs for a group.
project_idstringList timelogs for a project.
sortstringList timelogs in a particular order.
start_datestringList timelogs within a date range where the logged date is equal to or after startDate.
start_timestringList timelogs within a time range where the logged time is equal to or after startTime.
usernamestringList timelogs for a user.

SELECT examples​

Time logged on issues and merge requests in the project. Generated from the GitLab GraphQL schema field Project.timelogs (connection of Timelog nodes).

SELECT
id,
project,
spent_at,
summary,
time_spent,
user
FROM gitlab.projects.project_timelogs
WHERE full_path = '{{ full_path }}' -- required
AND host = '{{ host }}' -- required (defaults to gitlab.com; or set GITLAB_HOST)
AND end_date = '{{ end_date }}'
AND end_time = '{{ end_time }}'
AND group_id = '{{ group_id }}'
AND project_id = '{{ project_id }}'
AND sort = '{{ sort }}'
AND start_date = '{{ start_date }}'
AND start_time = '{{ start_time }}'
AND username = '{{ username }}'
;