turbot / steampipe-plugin-jira

Use SQL to instantly query Jira. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/jira
Apache License 2.0
22 stars 14 forks source link

add status_category column to jira_issue table #69

Closed gabrielsoltz closed 2 years ago

gabrielsoltz commented 2 years ago

Status Category in Jira is fixed: In Progress, To Do or Done. On the other hand, status is custom based on the workflow.

So if you need to list all Open tickets, you will need to know those custom statuses for your project, which is not always possible, and statuses can change from one project to another. That's why we can use status_category, which is always fixed for any project and workflow.

Example query results

Results ``` select status, status_category from local_jira.jira_issue +-------------------------+-----------------+ | status | status_category | +-------------------------+-----------------+ | Fixed | Done | | Open | To Do | | Fixed | Done | | Fixed | Done | | Open | To Do | | Sec Review | In Progress | | Fixed | Done | | Risk Accepted | Done | | In Progress | In Progress | | Fixed | Done | | In Progress | In Progress | | False Positive Accepted | Done | | Fixed | Done | | Fixed | Done | | Open | To Do | ```

Status and Status Category

You can use the field status or status_category to list issues in a particular workflow status.

The difference is that status is the custom name you define for a status_category in each Jira workflow that is fixed: To do, In Progress, and Done. Every status belongs to one of those status_category.

For example, for status_category = Done, maybe in your workflow you defined possible statuses Done and Wont Do, both are Done status category that you can filter using that status_category. status_category is also useful when filtering across more than 1 project, as every project could be using their own workflow with different status names.

misraved commented 2 years ago

Thanks for the PR @gabrielsoltz 👍 . Definitely worth adding the status_category column which provides users with the ability to easily query tickets based on pre-defined statuses.

Could you also add an example query in the docs/tables/jira_issue.md file that the users could easily refer to? For instance:

List Issues are in progress

select
  id,
  key,
  summary,
  status,
  assignee_display_name
from
  jira_issue
where
  status_category = 'In Progress';
gabrielsoltz commented 2 years ago

Thank you, @misraved. I updated the documentation. Let me know if this makes sense.

misraved commented 2 years ago

Thanks a lot @gabrielsoltz for making the changes and apologies for going back and forth on the table docs 👍 .

I will be releasing the change shortly 😃