jira integration template customfields
We using templates to fill the jira customfields, e.g.
{{- define "asp.priority" -}}
{{- with index .Alerts 0 -}}
{{- if .Labels.severity -}}
{{- if eq .Labels.severity "disaster" -}}
Sehr Hoch
{{- else if eq .Labels.severity "critical" -}}
Mittel
{{- else if eq .Labels.severity "warning" -}}
Mittel
{{- else if eq .Labels.severity "standard" -}}
Mittel
{{- else -}}
Mittel
{{- end -}}
{{- else -}}
Mittel
{{- end -}}
{{- end -}}
{{- end -}}
This code changes templates the custom fields before creating the issue, so we can use templates for custom fields
- name: test
jira_configs:
- project: Epic
issue_type: Alarm
fields:
customfield_14400: '{{ template "jira.host" . }}'
http_config:
authorization:
credentials:
Damn, seems like I forgot that. I would recommend to extend the tests.
Damn, seems like I forgot that. I would recommend to extend the tests.
No problem, I added a new template jira.host for the unit tests, please tell me if youre fine with this. otherwise we could use some existing template to test the customfields but I think with the new template it´s cleaner
@simonpasquier is there any chance to get this in 0.28?
I´ll fix the merge conflicts If the maintainer confirm this to be merged.
@simonpasquier I fixed the merge conflicts, would be highly appreciated to get this into main as we need this feature in our production environment.
could someone have a look at the unit test TestClusterVSInstance, as im not able to reproduce this failure.
Closes #4110
@simonpasquier could you have a look into this PR?
As we´re migration to Jira Cloud we really need to have the ability to use templated custom jira fields.
Hi any prediction on this getting merged? thanks
Hey @sysadmind any chance of this getting merged? We´re running this code in a production environment without any problems. Would be great to use the official version again and not a fork. I have one more improvement to the Jira Integration coming and then we could switch to the official version
Looks like there are some Go linting issues to fix.
Moved the DeepCopyWithTemplate function to template.go and improved its unit tests.
Thank you guys, hope this can come in a new release soon 🤞