Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jira integration template customfields #4029

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

holger-waschke
Copy link

@holger-waschke holger-waschke commented Sep 17, 2024

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: 

@holger-waschke holger-waschke force-pushed the hwa/add_jira_template_custom_fields branch from a55ee26 to 3c16236 Compare September 18, 2024 11:29
@jkroepke
Copy link
Contributor

jkroepke commented Sep 30, 2024

Damn, seems like I forgot that. I would recommend to extend the tests.

@holger-waschke holger-waschke force-pushed the hwa/add_jira_template_custom_fields branch from 40cf69c to 1864d6c Compare October 7, 2024 14:43
@holger-waschke holger-waschke force-pushed the hwa/add_jira_template_custom_fields branch from 1864d6c to 5fab22c Compare October 7, 2024 15:26
Signed-off-by: Holger Waschke <waschkester@gmail.com>
…ra.host to default.tmpl

Signed-off-by: Holger Waschke <waschkester@gmail.com>
Signed-off-by: Holger Waschke <waschkester@gmail.com>
@holger-waschke holger-waschke force-pushed the hwa/add_jira_template_custom_fields branch from 5fab22c to a6f0147 Compare October 7, 2024 15:27
@holger-waschke
Copy link
Author

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

Copy link
Contributor

@jkroepke jkroepke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - but I'm not an official maintainer.

@jkroepke
Copy link
Contributor

@simonpasquier is there any chance to get this in 0.28?

@holger-waschke
Copy link
Author

I´ll fix the merge conflicts If the maintainer confirm this to be merged.

@holger-waschke holger-waschke force-pushed the hwa/add_jira_template_custom_fields branch from 6dbd7cd to 15b7215 Compare November 12, 2024 10:40
Signed-off-by: Holger Waschke <waschkester@gmail.com>
@holger-waschke holger-waschke force-pushed the hwa/add_jira_template_custom_fields branch from 15b7215 to a8c416f Compare November 12, 2024 10:41
@holger-waschke
Copy link
Author

@simonpasquier
I fixed the merge conflicts, would be highly appreciated to get this into main as we need this feature in our production environment.

@holger-waschke
Copy link
Author

could someone have a look at the unit test TestClusterVSInstance, as im not able to reproduce this failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants