go-jira / jira

simple jira command line client in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

404 using jira create to on-premise Jira Server 9.x

prpht9 opened this issue · comments

What happened?
https://confluence.atlassian.com/jiracore/createmeta-rest-endpoint-to-be-removed-975040986.html

Jira 9.0 moved the parameters on api/2/issue/createmeta into path values
Need to allow both versions to function
Need a configuration item to indicate which url/method to call
Need to write the new method to conform to the new api method format
Need new jiradata type because the api endpoint changed the output json schema

slipstream to create jiradata types
slipscheme -stdout schema/IssueTypes.json > jiradata/IssueTypes.go

Old API Doc: https://docs.atlassian.com/software/jira/docs/api/REST/7.2.7/#api/2/issue-getCreateIssueMeta

New API Doc: https://docs.atlassian.com/software/jira/docs/api/REST/9.0.0/#issue-getCreateIssueMetaProjectIssueTypes

What did you expect to happen?
jira create should work against Jira Server 9.x

How can we reproduce it (as minimally and precisely as possible)?
setup .jira.d/config.yaml to point to a Jira Server 9.x

jira login
jira create
This should produce a 404

Minimal code helps us to identify the problem faster.

Anything else we need to know?
I have forked go-jira and attempted to create a fix for this. It is partially there. I at least figured out how to get it to work. But I don't know how you all would prefer to setup the configuration to choose between the old way and the new way. Also, I'm not that much of an expert with golang. So I may not have changed the code correctly. I'm hoping for some peer review and guidance so we can get this working for everyone.

Here is the PR I created in my fork: prpht9#1
I created the TODO.md file to track notes about my work
I created the schema/IssueTypes.json in order to use slipstream to create the jiradata/blah.go file(s)
These can be removed before merging but I felt they communicate good stuff
I can create a PR from my fork to this upstream repo if/whenever you wish. Just let me know.

Your Environment
On-Premise Jira Server 9.2, forked go-jira project, changed code, rm .jira.d/config.yml from project because it was locked to dev params, ./jira create

Include as many relevant details about the environment you experienced the problem in

go-jira version (git tag or sha): latest master
Go version (go version): 1.19.4
Jira type (cloud or on-premise): on-premise
Jira version / Api version: Jira 9.2 / api v2