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
Hi
I'm trying to create a new task using a cli running jira create -i Task, the response that I get doesn't contain any custom fields (im sending it to an editor).
When I try to save I get an error saying that a custom field was not provided: ERROR customfield_10059: Team is required.
I tried adding it to the config.yml file like this: customfield_10059: My Team but it didn't do anything.
How can I inject custom fields?
The text was updated successfully, but these errors were encountered:
here is an answer for anyone who wishes to do it in the future:
go-jira has a predefined template for the create operation. this template does not contain your custom fields. in order to support new fields you need to edit the template.
templates are not present by default, you need to create a file in ~/.jira.d/templates/create and paste the modified template there. you can find the templates in the templates.go file.
in my case this was the solution
{{/* create template */ -}}
fields:
project:
key: {{ or .overrides.project "" }}
issuetype:
name: {{ or .overrides.issuetype "" }}
summary: >-
{{ or .overrides.summary "" }}
{{- if .meta.fields.priority.allowedValues}}
priority: # Values: {{ range .meta.fields.priority.allowedValues }}{{.name}}, {{end}}
name: {{ or .overrides.priority ""}}
{{- end}}
{{- if .meta.fields.components.allowedValues}}
components: # Values: {{ range .meta.fields.components.allowedValues }}{{.name}}, {{end}}
{{ range split "," (or .overrides.components "")}}
- name: {{ . }}
{{end}}
{{- end}}
description: |~
{{ or .overrides.description "" | indent 4 }}
{{- if .meta.fields.assignee}}
assignee:
emailAddress: {{ or .overrides.assignee "" }}
{{end -}}
{{- if .meta.fields.reporter}}
reporter:
emailAddress: {{ or .overrides.reporter .overrides.login }}
{{end}}
{{- if .meta.fields.customfield_10110}}
# watchers
customfield_10110:
{{ range split "," (or .overrides.watchers "")}}
- name: {{.}}
{{end}}
- name:
{{- end}}
{{- if .meta.fields.customfield_10059}}
# team
customfield_10059: # Values: {{ range .meta.fields.customfield_10059.allowedValues }}{{.value}}, {{end}}
value: {{ (or .overrides.team "") }}
{{- end}}
Hi
I'm trying to create a new task using a cli running
jira create -i Task
, the response that I get doesn't contain any custom fields (im sending it to an editor).When I try to save I get an error saying that a custom field was not provided:
ERROR customfield_10059: Team is required.
I tried adding it to the config.yml file like this:
customfield_10059: My Team
but it didn't do anything.How can I inject custom fields?
The text was updated successfully, but these errors were encountered: