Skip to content

Using "title" in jiralert.tmpl fails with wrong type for value; expected language.Tag; got string #186

Open
@cjedro

Description

@cjedro

I´m currently trying to use title in the template but this fails with:

template: jiralert.tmpl:3:51: executing "jira.component" at <.GroupLabels.component>: wrong type for value; expected language.Tag; got string"

jiralert.tmpl

{{ define "jira.component" }}{{- .GroupLabels.component | title }}{{ end }}

jiralert.yml

template: jiralert.tmpl
defaults:
  api_url: https://xxx.atlassian.net
  description: "test"
  issue_type: Alert
  password: ""
  reopen_duration: 1h
  reopen_state: Reopening
  summary: "test"
  user: ""
  wont_fix_resolution: Won't Do

receivers:
  
  - name: 'jiralert-critical'
    project: 'OPS'
    add_group_labels: false
    priority: High
    fields:
      # Components
      components:
        - name: '{{ template "jira.component" . }}'

Am i missing something - looking at this line of code this should work, shouldn´t it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions