chobie / jira-api-restclient

php JIRA REST API
MIT License
217 stars 123 forks source link

Issue getter functions should work with automapping turned off / be language independent #198

Open equada opened 2 years ago

equada commented 2 years ago

In my opinion automapping is a bad idea because the array returned from the api is keyed by fixed keys, for example "resolutiondate". In english the key is then automapped/changed to "Resolutiondate" but labels are always subject to change, maybe jira changes it to "Resolution Date" in a future release, or maybe the labels are configurable. That would mean the getResolutionDate getter would be broken.

The actual problem: our Jira is in german, so the fields get automapped to the german field name. That means if automapping is turned on, getResolutionDate doesn't find a field named "Resolutiondate" in the fields array. If automapping is turned off via the options, the field is named "resolutiondate" and it also cannot get a field called "Resolutiondate"

Basically the getters only work if you have automapping turned on and your jira happens to be in english.

aik099 commented 2 years ago

Thanks for finding this out. Would you please send a PR?