You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ if .IsCustomType -}}{{- template "attributes" . }}{{- else }}
4
-
- `{{ .BlockName }}` ({{ if .Optional }}optional {{ end }}{{ .Type }}) {{ .Description }}{{- end -}}
5
-
{{- end }}
1
+
{{- define "enum_attribute" -}}
2
+
- `{{ .BlockName }}` ({{ if .Optional }}optional {{ end }}enum) {{ .Description }}
3
+
{{- range .Enum.Values }}
4
+
- `{{ .Name }}` - {{ .Description }}
5
+
{{- end -}}
6
6
{{- end -}}
7
7
8
-
### Attributes
9
-
{{ template "attributes" . -}}
8
+
{{- define "single_attribute" -}}- `{{ .BlockName }}` ({{ if .Optional }}optional {{ end }}{{ .Type }}){{ if .Description}} {{ .Description -}}{{ end }}{{- end -}}
{{- define "attributes" -}}{{- range .Attributes -}}
23
+
{{- if .IsCustomType }}{{ template "custom_type" . }}
24
+
{{- else if .IsEnum }}{{- template "enum_attribute" . }}
25
+
{{- else }}{{- template "single_attribute" . }}
26
+
{{ end }}
27
+
{{- end -}}
28
+
{{- end -}}
29
+
30
+
# Script Attributes
31
+
32
+
!!! tip "The [Expr Language Definition](https://expr-lang.org/docs/language-definition) is a great resource to learn more about the language"
33
+
34
+
!!! note
35
+
36
+
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.
37
+
38
+
The following attributes are available in `script` fields.
39
+
40
+
They can be accessed exactly as shown in this list.
41
+
42
+
{{ template "attributes" . }}
43
+
44
+
## `webhook_event`
45
+
46
+
!!! tip "`webhook_event` attribute is only available in `server` mode"
47
+
48
+
You have access to the raw webhook event payload via `webhook_event.*` attributes (not listed below) in Expr script fields when using [`server`](#server) mode.
49
+
50
+
See the [GitLab Webhook Events documentation](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html) for available fields.
51
+
52
+
The attributes are named _exactly_ as documented in the GitLab documentation.
53
+
54
+
- [`Comments`](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#comment-events) - A comment is made or edited on an issue or merge request.
55
+
- [`Merge request events`](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events) - A merge request is created, updated, or merged.
0 commit comments