sumoheavy / jira-ruby

A Ruby gem for the JIRA REST API
MIT License
654 stars 412 forks source link

Support The Workflow Status Category Resource #426

Closed jcouball closed 4 months ago

jcouball commented 6 months ago

This gem does not implement Workflow Status Category as a proper resource so it can be treated like an object.

This PR adds the JIRA::Resource::StatusCategory and relationship from JIRA::Resource::Status to this resource. This enables:

I believe this change is backward compatible even if client.Field.map_fields is called since the mapping would create status#statusCategory method which would not conflict with status#status_category. I also believe this gem would work if the server did not return statusCategory data in the status objects.

In addition to adding the status_category mocked responses, I have also added statusCategory data to the status mocked responses.

There is a surprising change needed to lib/jira/base.rb because the ids for statuscategory resources are an Integer where all other resources have String keys. This is how Jira returns these objects.

jcouball commented 6 months ago

@SimonMiaou this PR is ready for review.