Skip to content
Open
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# dbt_jira v1.8.0-a1

[PR #178](https://github.com/fivetran/dbt_jira/pull/178) includes the following updates:

## Bug Fix
- Updates `jira__sprint_enhanced` to resolve the team per issue per sprint when `jira_using_teams` is enabled. Previously, if an issue had no team assigned at any point during the sprint, the team would appear as null even if a team was later assigned. An additional row would also be created if an issue moved from one team to another within a sprint, causing potential double counting. Now, the model selects the most recent non-null team for each issue-sprint combination, ensuring team assignments are correctly reflected in sprint metrics.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a schema/data breaking change? The data values for team will change for customers upgrading. We should create that section.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't totally sure whether to classify this as a bugfix or feature update. It will change row counts for some but not others, depending on how they set up their Jira instance and whether they have teams enabled. Definitely want to discuss further if/when this becomes a full release but don't think a changelog entry needs to hold up a pre-release.


## Documentation
- Updated the `jira__sprint_enhanced` model description in the README to clarify that granularity is one row per team per sprint when teams are enabled.

# dbt_jira v1.7.0

[PR #175](https://github.com/fivetran/dbt_jira/pull/175) includes the following updates:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ By default, this package materializes the following final tables:
| [jira__issue_enhanced](https://fivetran.github.io/dbt_jira/#!/model/model.jira.jira__issue_enhanced) | One row per Jira issue with enriched details about assignee, reporter, sprint, project, and current status, plus metrics on assignments and re-openings. <br><br>**Example Analytics Questions:**<br><ul><li>How many issues are currently blocked and who owns them?</li><li>What's the average time to resolution for high-priority bugs by assignee?</li></ul> |
| [jira__project_enhanced](https://fivetran.github.io/dbt_jira/#!/model/model.jira.jira__project_enhanced) | One row per project with team member details, issue counts, work velocity metrics, and project scope information. <br><br>**Example Analytics Questions:**<br><ul><li>Which projects have the highest velocity in terms of issues closed per sprint?</li><li>What is the ratio of unassigned open tickets to assigned open tickets by project?</li></ul> |
| [jira__user_enhanced](https://fivetran.github.io/dbt_jira/#!/model/model.jira.jira__user_enhanced) | One row per user with metrics on open and completed issues, and individual work velocity. <br><br>**Example Analytics Questions:**<br><ul><li>Who are the top performers in terms of issues resolved per month?</li><li>Which team members have the highest workload based on open issue count and how long, on average, have those issues been open?</li></ul> |
| [jira__sprint_enhanced](https://fivetran.github.io/dbt_jira/#!/model/model.jira.jira__sprint_enhanced) | One row per sprint with metrics on issues created, resolved, and carried over, plus story point estimates. <br><br>**Example Analytics Questions:**<br><ul><li>Which sprints had the highest velocity and what made them successful?</li><li>How many story points were planned vs. completed across recent sprints?</li><li>What percentage of issues are typically carried over from sprint to sprint?</li></ul> |
| [jira__sprint_enhanced](https://fivetran.github.io/dbt_jira/#!/model/model.jira.jira__sprint_enhanced) | One row per sprint with metrics on issues created, resolved, and carried over, plus story point estimates. If teams are enabled, granularity is one row per team per sprint. <br><br>**Example Analytics Questions:**<br><ul><li>Which sprints had the highest velocity and what made them successful?</li><li>How many story points were planned vs. completed across recent sprints?</li><li>What percentage of issues are typically carried over from sprint to sprint?</li></ul> |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the yml description as well? Will need to regen docs afterward

| [jira__daily_sprint_issue_history](https://fivetran.github.io/dbt_jira/#!/model/model.jira.jira__daily_sprint_issue_history) | Daily snapshot of each sprint showing all associated issues from sprint start to end, useful for tracking progress over time. <br><br>**Example Analytics Questions:**<br><ul><li>How many issues were active in each sprint on any given day?</li><li>What's the daily count of open vs. completed issues per sprint?</li><li>Which sprints had issues added or removed mid-sprint?</li></ul> |

¹ Each Quickstart transformation job run materializes these models if all components of this data model are enabled. This count includes all staging, intermediate, and final models materialized as `view`, `table`, or `incremental`.
Expand All @@ -66,7 +66,7 @@ Include the following jira package version in your `packages.yml` file:
```yaml
packages:
- package: fivetran/jira
version: [">=1.7.0", "<1.8.0"]
version: 1.8.0-a1
```

> All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/jira_source` in your `packages.yml` since this package has been deprecated.
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'jira'
version: '1.7.0'
version: '1.8.0'
config-version: 2
require-dbt-version: [">=1.3.0", "<3.0.0"]

Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'jira_integration_tests'
version: '1.7.0'
version: '1.8.0'
config-version: 2
profile: 'integration_tests'

Expand Down
2 changes: 1 addition & 1 deletion models/jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ models:
- name: jira__sprint_enhanced
description: >
This model provides enhanced sprint-level metrics in Jira, incorporating data from sprints,
sprint-related issue history, and sprint-based story points tracking.
sprint-related issue history, and sprint-based story points tracking. If teams are enabled, granularity is one row per team per sprint.
columns:
- name: source_relation
description: "{{ doc('source_relation') }}"
Expand Down
87 changes: 83 additions & 4 deletions models/jira__sprint_enhanced.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,86 @@ with daily_sprint_issue_history as (

select *
from {{ ref('jira__daily_sprint_issue_history') }}

),

{% if using_teams %}

ranked_issue_sprint_team as (

select
source_relation,
sprint_id,
issue_id,
team,
row_number() over (
partition by source_relation, sprint_id, issue_id
order by
case when team is not null then 0 else 1 end,
date_day desc
) as row_num
from daily_sprint_issue_history

),

resolved_issue_sprint_team as (

select
source_relation,
sprint_id,
issue_id,
team
from ranked_issue_sprint_team
where row_num = 1

),

daily_sprint_issue_history_resolved as (

select
daily_sprint_issue_history.source_relation,
daily_sprint_issue_history.issue_id,
daily_sprint_issue_history.sprint_id,
resolved_issue_sprint_team.team,
daily_sprint_issue_history.date_day,
daily_sprint_issue_history.sprint_name,
daily_sprint_issue_history.sprint_started_at,
daily_sprint_issue_history.sprint_ended_at,
daily_sprint_issue_history.sprint_completed_at,
daily_sprint_issue_history.board_id,
daily_sprint_issue_history.assignee_user_id,
daily_sprint_issue_history.original_estimate_seconds,
daily_sprint_issue_history.remaining_estimate_seconds,
daily_sprint_issue_history.time_spent_seconds,
daily_sprint_issue_history.is_sprint_active,
daily_sprint_issue_history.is_issue_open,
daily_sprint_issue_history.issue_resolved_at,
daily_sprint_issue_history.is_issue_resolved_in_sprint
{% if include_story_points %}
, daily_sprint_issue_history.story_points
{% endif %}
{% if include_story_point_estimate %}
, daily_sprint_issue_history.story_point_estimate
{% endif %}
from daily_sprint_issue_history
left join resolved_issue_sprint_team
on daily_sprint_issue_history.source_relation = resolved_issue_sprint_team.source_relation
and daily_sprint_issue_history.sprint_id = resolved_issue_sprint_team.sprint_id
and daily_sprint_issue_history.issue_id = resolved_issue_sprint_team.issue_id

),

{% else %}

daily_sprint_issue_history_resolved as (

select *
from daily_sprint_issue_history

),

{% endif %}

sprint_metrics_grouped as (

select
Expand All @@ -32,7 +111,7 @@ sprint_metrics_grouped as (
original_estimate_seconds,
remaining_estimate_seconds,
time_spent_seconds
from daily_sprint_issue_history
from daily_sprint_issue_history_resolved
{{ dbt_utils.group_by(11 if using_teams else 10) }}
),

Expand All @@ -48,7 +127,7 @@ sprint_issue_metrics as (
count(distinct (case when date_day >= cast(issue_resolved_at as date)
and issue_resolved_at <= sprint_ended_at
then issue_id end)) as resolved_sprint_issues
from daily_sprint_issue_history
from daily_sprint_issue_history_resolved
{{ dbt_utils.group_by(3 if using_teams else 2) }}
),

Expand All @@ -65,7 +144,7 @@ sprint_start_metrics as (
sum(case when story_point_estimate is null then 0 else story_point_estimate end) as story_point_estimate_committed,
{% endif %}
count(distinct issue_id) as issues_committed
from daily_sprint_issue_history
from daily_sprint_issue_history_resolved
-- to capture both sprints that have started or will start in the future
where date_day = cast(sprint_started_at as date)
or (date_day < cast(sprint_started_at as date)
Expand All @@ -87,7 +166,7 @@ sprint_end_metrics as (
, sum(case when story_point_estimate is null then 0 else story_point_estimate end) as story_point_estimate_end
, sum(case when is_issue_resolved_in_sprint then story_point_estimate else 0 end) as story_point_estimate_completed
{% endif %}
from daily_sprint_issue_history
from daily_sprint_issue_history_resolved
where date_day = cast(sprint_ended_at as date)
{{ dbt_utils.group_by(3 if using_teams else 2) }}
),
Expand Down