Script Attributes¶
The Expr Language Definition is a great resource to learn more about the language
Note
Missing an attribute? The schema/gitlab.schema.graphqls
file are what is used to query GitLab, adding the missing field
to the right type
should make it accessible. Please open an issue or Pull Request if something is missing.
The following attributes are available in script
fields.
They can be accessed exactly as shown in this list.
repository
¶
The project the Pull Request belongs to
repository.allow_update_branch
;boolean
. Whether or not a Pull Request head branch that is behind its base branch can always be updated even if it is not required to be up to date before mergingrepository.archived_at
;optional time
. Identifies the date and time when the repository was archivedrepository.auto_merge_allowed
;boolean
. Whether or not Auto-merge can be enabled on Pull Requests in this repositoryrepository.created_at
;time
. Identifies the date and time when the object was createdrepository.delete_branch_on_merge
;boolean
. Whether or not branches are automatically deleted when merged in this repositoryrepository.description
;optional string
. The description of the repositoryrepository.has_discussions_enabled
;boolean
. Indicates if the repository has the Discussions feature enabledrepository.has_issues_enabled
;boolean
. Indicates if the repository has issues feature enabledrepository.has_projects_enabled
;boolean
. Indicates if the repository has the Projects feature enabledrepository.has_wiki_enabled
;boolean
. Indicates if the repository has wiki feature enabledrepository.id
;string
. The Node ID of the Repository objectrepository.is_archived
;boolean
. Indicates if the repository is unmaintainedrepository.is_blank_issues_enabled
;boolean
. Returns true if blank issue creation is allowedrepository.is_disabled
;boolean
. Returns whether or not this repository disabledrepository.is_fork
;boolean
. Identifies if the repository is a forkrepository.is_locked
;boolean
. Indicates if the repository has been locked or notrepository.is_mirror
;boolean
. Identifies if the repository is a mirrorrepository.is_private
;boolean
. Identifies if the repository is private or internalrepository.is_template
;boolean
. Identifies if the repository is a template that can be used to generate new repositoriesrepository.is_user_configuration_repository
;boolean
. Is this repository a user configuration repositoryrepository.merge_commit_allowed
;boolean
. Whether or not PRs are merged with a merge commit on this repositoryrepository.name
;string
. The name of the repositoryrepository.name_with_owner
;string
. The repository's name with ownerrepository.pushed_at
;optional time
. Identifies the date and time when the repository was last pushed torepository.rebase_merge_allowed
;boolean
. Whether or not rebase-merging is enabled on this repositoryrepository.resource_path
;string
. The HTTP path for this repositoryrepository.squash_merge_allowed
;boolean
. Whether or not squash-merging is enabled on this repositoryrepository.stargazer_count
;int
. Returns a count of how many stargazers there are on this objectrepository.updated_at
;time
. Identifies the date and time when the object was last updatedrepository.url
;string
. The HTTP URL for this repository-
repository.visibility
(enum) Indicates the repository's visibility levelThe following values are valid:
PRIVATE
The repository is visible only to those with explicit accessPUBLIC
The repository is visible to everyoneINTERNAL
The repository is visible only to users in the same business
owner
¶
The project owner
owner.login
;string
. The username used to login
pull_request
¶
Information about the Pull Request
-
pull_request.active_lock_reason
(optional enum) Reason that the conversation was lockedThe following values are valid:
OFF_TOPIC
The issue or Pull Request was locked because the conversation was off-topicTOO_HEATED
The issue or Pull Request was locked because the conversation was too heatedRESOLVED
The issue or Pull Request was locked because the conversation was resolvedSPAM
The issue or Pull Request was locked because the conversation was spam
-
pull_request.additions
;int
. The number of additions in this Pull Request pull_request.base_ref_name
;string
. Identifies the name of the base Ref associated with the Pull Request, even if the ref has been deletedpull_request.body
;string
. The body as Markdownpull_request.can_be_rebased
;boolean
. Whether or not the Pull Request is rebaseablepull_request.changed_files
;int
. The number of changed files in this Pull Requestpull_request.closed
;boolean
.true
if the Pull Request is closedpull_request.closed_at
;optional time
. Identifies the date and time when the object was closedpull_request.created_at
;time
. Identifies the date and time when the object was createdpull_request.created_via_email
;boolean
. Check if this comment was created via an email replypull_request.deletions
;int
. The number of deletions in this Pull Requestpull_request.head_ref_name
;string
. Identifies the name of the head Ref associated with the Pull Request, even if the ref has been deletedpull_request.id
;string
. The Node ID of the PullRequest objectpull_request.includes_created_edit
;boolean
. Check if this comment was edited and includes an edit with the creation datapull_request.is_cross_repository
;boolean
. The head and base repositories are differentpull_request.is_draft
;boolean
. Identifies if the Pull Request is a draftpull_request.is_in_merge_queue
;boolean
. Indicates whether the Pull Request is in a merge queuepull_request.is_merge_queue_enabled
;boolean
. Indicates whether the Pull Request's base ref has a merge queue enabledpull_request.last_edited_at
;optional time
. The moment the editor made the last editpull_request.locked
;boolean
.true
if the Pull Request is lockedpull_request.maintainer_can_modify
;boolean
. Indicates whether maintainers can modify the Pull Request-
pull_request.merge_state_status
(enum) Detailed information about the current Pull Request merge state statusThe following values are valid:
DIRTY
The merge commit cannot be cleanly createdUNKNOWN
The state cannot currently be determinedBLOCKED
The merge is blockedBEHIND
The head ref is out of dateUNSTABLE
Mergeable with non-passing commit statusHAS_HOOKS
Mergeable with passing commit status and pre-receive hooksCLEAN
Mergeable and passing commit status
-
pull_request.mergeable
(enum) Whether or not the Pull Request can be merged based on the existence of merge conflictsThe following values are valid:
MERGEABLE
The Pull Request can be mergedCONFLICTING
The Pull Request cannot be merged due to merge conflictsUNKNOWN
The mergeability of the Pull Request is still being calculated
-
pull_request.merged
;boolean
. Whether or not the Pull Request was merged pull_request.merged_at
;optional time
. The date and time that the Pull Request was mergedpull_request.number
;int
. Identifies the Pull Request numberpull_request.permalink
;string
. The permalink to the Pull Requestpull_request.published_at
;optional time
. Identifies when the comment was published atpull_request.resource_path
;string
. The HTTP path for this Pull Request-
pull_request.review_decision
(enum) The current status of this Pull Request with respect to code reviewThe following values are valid:
CHANGES_REQUESTED
Changes have been requested on the Pull RequestAPPROVED
The Pull Request has received an approving reviewREVIEW_REQUIRED
A review is required before the Pull Request can be merged
-
pull_request.state
(enum) Identifies the state of the Pull RequestThe following values are valid:
OPEN
A Pull Request that is still openCLOSED
A Pull Request that has been closed without being mergedMERGED
A Pull Request that has been closed by being merged
-
pull_request.time_between_first_and_last_commit
;optional duration
. Duration between first and last commit made pull_request.time_since_first_commit
;optional duration
. Duration (from 'now') since the first commit was madepull_request.time_since_last_commit
;optional duration
. Duration (from 'now') since the last commit was madepull_request.title
;string
. Identifies the Pull Request titlepull_request.total_comments_count
;optional int
. Returns a count of how many comments this Pull Request has receivedpull_request.updated_at
;time
. Identifies the date and time when the object was last updatedpull_request.url
;string
. The HTTP URL for this Pull Request
pull_request.files[]
¶
pull_request.files[].additions
;int
. The number of additions to the file-
pull_request.files[].change_type
(enum) How the file was changed in this PullRequestThe following values are valid:
ADDED
The file was added. Git status 'A'DELETED
The file was deleted. Git status 'D'RENAMED
The file was renamed. Git status 'R'COPIED
The file was copied. Git status 'C'MODIFIED
The file's contents were changed. Git status 'M'CHANGED
The file's type was changed. Git status 'T'
-
pull_request.files[].deletions
;int
. The number of deletions to the file pull_request.files[].path
;string
. The path of the file
pull_request.first_commit
¶
Information about the first commit made
pull_request.first_commit.additions
;int
. The number of additions in this commitpull_request.first_commit.authored_by_committer
;boolean
. Check if the committer and the author matchpull_request.first_commit.authored_date
;time
. The datetime when this commit was authoredpull_request.first_commit.changed_files_if_available
;optional int
. The number of changed files in this commit. If GitHub is unable to calculate the number of changed files (for example due to a timeout), this will return null. We recommend using this field instead of changedFilespull_request.first_commit.commit_resource_path
;string
. The HTTP path for this Git objectpull_request.first_commit.commit_url
;string
. The HTTP URL for this Git objectpull_request.first_commit.committed_date
;time
. The datetime when this commit was committedpull_request.first_commit.committed_via_web
;boolean
. Check if committed via GitHub web UIpull_request.first_commit.deletions
;int
. The number of deletions in this commitpull_request.first_commit.message
;string
. The Git commit messagepull_request.first_commit.message_body
;string
. The Git commit message bodypull_request.first_commit.message_headline
;string
. The Git commit message headlinepull_request.first_commit.url
;string
. The HTTP URL for this commit
pull_request.first_commit.author
¶
Authorship details of the commit
pull_request.first_commit.author.date
;optional time
. The timestamp of the Git action (authoring or committing)pull_request.first_commit.author.email
;optional string
. The email in the Git commitpull_request.first_commit.author.name
;optional string
. The name in the Git commit
pull_request.first_commit.author.user
¶
The GitHub user corresponding to the email field. Null if no such user exists
pull_request.first_commit.author.user.login
;string
. The username used to login
pull_request.first_commit.committer
¶
Committer details of the commit
pull_request.first_commit.committer.date
;optional time
. The timestamp of the Git action (authoring or committing)pull_request.first_commit.committer.email
;optional string
. The email in the Git commitpull_request.first_commit.committer.name
;optional string
. The name in the Git commit
pull_request.first_commit.committer.user
¶
The GitHub user corresponding to the email field. Null if no such user exists
pull_request.first_commit.committer.user.login
;string
. The username used to login
pull_request.last_commit
¶
Information about the last commit made
pull_request.last_commit.additions
;int
. The number of additions in this commitpull_request.last_commit.authored_by_committer
;boolean
. Check if the committer and the author matchpull_request.last_commit.authored_date
;time
. The datetime when this commit was authoredpull_request.last_commit.changed_files_if_available
;optional int
. The number of changed files in this commit. If GitHub is unable to calculate the number of changed files (for example due to a timeout), this will return null. We recommend using this field instead of changedFilespull_request.last_commit.commit_resource_path
;string
. The HTTP path for this Git objectpull_request.last_commit.commit_url
;string
. The HTTP URL for this Git objectpull_request.last_commit.committed_date
;time
. The datetime when this commit was committedpull_request.last_commit.committed_via_web
;boolean
. Check if committed via GitHub web UIpull_request.last_commit.deletions
;int
. The number of deletions in this commitpull_request.last_commit.message
;string
. The Git commit messagepull_request.last_commit.message_body
;string
. The Git commit message bodypull_request.last_commit.message_headline
;string
. The Git commit message headlinepull_request.last_commit.url
;string
. The HTTP URL for this commit
pull_request.last_commit.author
¶
Authorship details of the commit
pull_request.last_commit.author.date
;optional time
. The timestamp of the Git action (authoring or committing)pull_request.last_commit.author.email
;optional string
. The email in the Git commitpull_request.last_commit.author.name
;optional string
. The name in the Git commit
pull_request.last_commit.author.user
¶
The GitHub user corresponding to the email field. Null if no such user exists
pull_request.last_commit.author.user.login
;string
. The username used to login
pull_request.last_commit.committer
¶
Committer details of the commit
pull_request.last_commit.committer.date
;optional time
. The timestamp of the Git action (authoring or committing)pull_request.last_commit.committer.email
;optional string
. The email in the Git commitpull_request.last_commit.committer.name
;optional string
. The name in the Git commit
pull_request.last_commit.committer.user
¶
The GitHub user corresponding to the email field. Null if no such user exists
pull_request.last_commit.committer.user.login
;string
. The username used to login
pull_request.merged_by
¶
The actor who merged the Pull Request
pull_request.merged_by.login
;string
. The username used to login
pull_request.author
¶
The actor who authored the comment
pull_request.author.login
;string
. The username used to login
pull_request.labels[]
¶
Labels available on this project
pull_request.labels[].color
;string
. Identifies the label colorpull_request.labels[].created_at
;optional time
. Identifies the date and time when the label was createdpull_request.labels[].description
;optional string
. A brief description of this labelpull_request.labels[].id
;string
. The Node ID of the Label objectpull_request.labels[].is_default
;boolean
. Indicates whether or not this is a default labelpull_request.labels[].name
;string
. Identifies the label namepull_request.labels[].updated_at
;time
. Identifies the date and time when the label was last updated
viewer
¶
Get information about current user
viewer.login
;string
. The username used to login
webhook_event
¶
webhook_event
attribute is only available in server
mode
You have access to the raw webhook event payload via webhook_event.*
attributes (not listed below) in Expr script fields when using server
mode.
See the GitLab Webhook Events documentation for available fields.
The attributes are named exactly as documented in the GitLab documentation.
Comments
- A comment is made or edited on an issue or merge request.Merge request events
- A merge request is created, updated, or merged.