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
I have a customfield 23210. If I pass is statically as an array [{'key':'PSK-713555'},{'key':'PSK-953155'}] it works just fine, if i pass it trough the template the output is exactly the same but it doesnt get passed as an array
template definition: {{ define "jira.psk" -}}{{ with index .Alerts 0 -}}{{- $elements := split .Labels.insight_psk "," -}}[{{- range $index, $element := $elements -}}{{ if $index }},{{ end }}{'key':'{{ $element }}'}{{ end -}}]{{ end -}}{{ end -}}
Error from Jira: Jun 05 19:24:16 alert-test01.1.xxx jiralert[7224]: level=error ts=2023-06-05T17:24:16.717689448Z caller=main.go:180 msg="error handling request" statusCode=400 statusText="Bad Request" err="JIRA request https://projektportal.xxx/jira/rest/api/2/issue returned status 400 Bad Request, error \"request failed. Please analyze the request body for more details. Status code: 400\", body \"{\\\"errorMessages\\\":[],\\\"errors\\\":{\\\"customfield_23210\\\":\\\"data was not an array\\\"}}\"" receiver=mon_alarm groupLabels="unsupported value type"
what i noticed is a slightly different process mode, I guess in the function "deepCopyWithTemplate" it doesn´t get interpreted as an array from the reflect library
this is from the log output if it works Unknowns:map[customfield_23210:[map[key:PSK-713555] map[key:PSK-953155]]]}"
and this is from the template which doesnt work Unknowns:map[customfield_23210:[{'key':'PSK-713555'},{'key':'PSK-953155'}]]}"
The text was updated successfully, but these errors were encountered:
I also need this functionality, but as far as I understand, this is a limitation of the text template that returns a non-alternative string object that is substituted after YML serialization.
I have a customfield 23210. If I pass is statically as an array
[{'key':'PSK-713555'},{'key':'PSK-953155'}]
it works just fine, if i pass it trough the template the output is exactly the same but it doesnt get passed as an arraytemplate definition:
{{ define "jira.psk" -}}{{ with index .Alerts 0 -}}{{- $elements := split .Labels.insight_psk "," -}}[{{- range $index, $element := $elements -}}{{ if $index }},{{ end }}{'key':'{{ $element }}'}{{ end -}}]{{ end -}}{{ end -}}
log output:
Error from Jira:
Jun 05 19:24:16 alert-test01.1.xxx jiralert[7224]: level=error ts=2023-06-05T17:24:16.717689448Z caller=main.go:180 msg="error handling request" statusCode=400 statusText="Bad Request" err="JIRA request https://projektportal.xxx/jira/rest/api/2/issue returned status 400 Bad Request, error \"request failed. Please analyze the request body for more details. Status code: 400\", body \"{\\\"errorMessages\\\":[],\\\"errors\\\":{\\\"customfield_23210\\\":\\\"data was not an array\\\"}}\"" receiver=mon_alarm groupLabels="unsupported value type"
what i noticed is a slightly different process mode, I guess in the function "deepCopyWithTemplate" it doesn´t get interpreted as an array from the reflect library
this is from the log output if it works
Unknowns:map[customfield_23210:[map[key:PSK-713555] map[key:PSK-953155]]]}"
and this is from the template which doesnt work
Unknowns:map[customfield_23210:[{'key':'PSK-713555'},{'key':'PSK-953155'}]]}"
The text was updated successfully, but these errors were encountered: