fivetran / dbt_jira

Data models for Fivetran's Jira connector built using dbt.
https://fivetran.github.io/dbt_jira/
Apache License 2.0
8 stars 15 forks source link

[Bug] choose latest-ending sprint in issue_enhanced if there are multiple sprints #72

Closed fivetran-jamie closed 1 year ago

fivetran-jamie commented 2 years ago

Is there an existing issue for this?

Describe the issue

When we first developed the package, we were under the impression that a Jira issue could only be associated with one sprint at a time. However, this is not the case. When a sprint is completed with an incomplete issue, the issue is automatically rolled over to the next sprint (but still associated with the old sprint as well).

Because we made this assumption, if an issue is associated with 3 sprints, we choose the sprint whose information to highlight in the issue_enhanced model kinda at random (they all have the same updated_at and we just order by that in the row_number window function).

So, if an issue is rolled over, we may still point to the outdated sprint in the issue_enhanced model. Instead, we should choose the latest sprint, using the sprint_started_at and/or sprint_ended_at fields to determine which sprint to highlight for the issue.

Also, we may want to prepend sprint-data in this model with current_sprint_ or active_sprint_ or something because there's an additional sprint field passed on from the daily issue field history model. This sprint field is a comma-separated list of all the related sprint ids. Could be worth differentiating them better. (also could be worth using the sprint names instead of ids)

Relevant error log or model output

Outdated sprint info inn `jira__issue_enhanced`

Expected behavior

Sprint info should reflect the latest sprint

dbt Project configurations

na

Package versions

na

What database are you using dbt with?

postgres, redshift, snowflake, bigquery, databricks

dbt Version

na

Additional Context

No response

Are you willing to open a PR to help address this issue?

fivetran-catfritz commented 1 year ago

Reopened this issue as the latest release introduced some unexpected behavior. We are prioritizing looking into it!