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

not able to fill customfield_10002 from alert label value #136

Open
amed005 opened this issue Nov 9, 2022 · 2 comments
Open

not able to fill customfield_10002 from alert label value #136

amed005 opened this issue Nov 9, 2022 · 2 comments

Comments

@amed005
Copy link

amed005 commented Nov 9, 2022

Hi, i want to fill the customfield_10002 (organization id) with the value of an alert label but i had no luck so far.

jiralert-configmap

    # Receiver definitions. At least one must be defined.
    receivers:
        # Must match the Alertmanager receiver name. Required.
      - name: 'xxx'
        project: "{{ .CommonLabels.projectkey }}"
        add_group_labels: false
        fields:
          "customfield_10147": { "value": "{{ .CommonLabels.environment }}" }
          "customfield_10002": [322]

Inserting the value like in the example above works and displays the organization correctly inside the jira ticket.

But when using a variable like this:
"customfield_10002": [ {{ .CommonLabels.organizationid }} ]
an error is thrown at start of jiralert:
level=error ts=2022-11-08T16:09:07.701670386Z caller=main.go:76 msg="error loading configuration" path=config/jiralert.yml err="yaml: invalid map key: map[interface {}]interface {}{".CommonLabels.organizationid":interface {}(nil)}"

Any ideas? i cant get this working, not matter what i try.

@fpizarro-pcf
Copy link

Pudiste solucionarlo?

@sthomson-wyn
Copy link

The issue is that the template isn't quoted, so it's being interpreted as yaml

change to

      "customfield_10002": [ "{{ .CommonLabels.organizationid }}" ]

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

No branches or pull requests

3 participants