Skip to content

Enhancing JSON formatting for project functionality #7572

@kamaz

Description

@kamaz

Describe the feature or problem you’d like to solve

I really like the new feature of being able to use the cli tool with the project functionality. However, it would be quite helpful to add a title property in some areas of the response when using json formatting, especially for the iteration and milestone fields.

Proposed solution

When following command is used:

/usr/local/bin/gh project item-list 1 --owner "<owner>" --limit 1000 --format json | jq '.items'

It produces the following JSON output::

{
    "id": "PVTI_lADOBsQO_s4AGj6izgGwNWE",
     ...
    "milestone": {
      "description": "very long description for milestone",
      "dueOn": ""
    },
    // sprint field is an example of iteration field 
    "sprint": {
      "startDate": "2023-07-01",
      "duration": 28
    },
  },

In my opinion, it would be beneficial to include a title property with a corresponding value for the milestone and iteration fields. This would allow for easier filtering using tools like jq instead of relying solely on the description which can be long and hard to use with other tools. For example:

{
    "id": "PVTI_lADOBsQO_s4AGj6izgGwNWE",
     ...
    "milestone": {
      "description": "very long description for milestone",
      "dueOn": "",
      // proposed new field "title"
      "title": "beta-1"
    },
     // sprint field is an example of iteration field 
    "sprint": {
      "startDate": "2023-07-01",
      "duration": 28,
      // proposed new field "title"
      "title": "beta-1"
    },
  },

Please note that the above solution assumes the inclusion of a title property in the JSON response for both the milestone and iteration fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions