go-jira / jira

simple jira command line client in Go
Apache License 2.0
2.68k stars 328 forks source link

fix createmeta issue on jira 9.x #502

Open prpht9 opened 7 months ago

prpht9 commented 7 months ago
jmtd commented 7 months ago

I can't formally review this, but it has fixed the problem for me. From a merging POV, the TODO.md is superfluous, and the additional config value should be documented. I didn't need to set it in order to file an issue, and I'm still unsure what circumstances I'd need to set it and to what.

darthwalsh commented 3 weeks ago

@prpht9 I was trying out this PR, and hit a small issue with overriding components using jira create.

My jira server (v9.12.12) responded to /rest/api/2/issue/createmeta/ABC/issuetypes without any .allowedValues in the response. I needed to query a specific issue type e.g. /rest/api/2/issue/createmeta/ABC/issuetypes/3 and then .allowedValues showed up for all fields.

This led to the default create template not having any .meta.fields.components.allowedValues , which leads to CLI jira create --override components=Something getting ignored. It's might be fair to call "components gets ignored" a separate preexisting issue, but it's exposed by this PR's fix.

As a workaround, I created a custom creation template that hardcodes

  components:
    - name: {{ .overrides.component }}