Skip to content

Commit ab172a6

Browse files
Feature/add teams to jira package (#149)
* feature/add_teams_to_jira_package * add_team_column_to_end_models * update_seed_data * add_teams_to_timestamp_model * update_columns * remove_team__hardcoding * update_changelog
1 parent b56e670 commit ab172a6

16 files changed

Lines changed: 191 additions & 31 deletions

.quickstart/quickstart.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ table_variables:
1212
- version
1313
jira_using_priorities:
1414
- priority
15+
jira_using_teams:
16+
- team
1517

1618
destination_configurations:
1719
databricks:

CHANGELOG.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
# dbt_jira v1.1.0
22

3-
## Schema Updates
3+
## Schema/Data Change
4+
**8 total changes • 6 possible breaking changes**
45

5-
**6 total changes • 4 possible breaking changes**
6-
7-
| Data Model | Change Type | Old | New | Notes |
8-
|---------------------------------------------------|-------------|----------|-------------------------------------------|-------------------------------------------------------------------|
6+
| Data Model(s) | Change type | Old | New | Notes |
7+
| ---------- | ----------- | -------- | -------- | ----- |
8+
| [stg_jira__team_tmp](https://fivetran.github.io/dbt_jira/#!/model/model.jira.stg_jira__team) | New Model | | | Added temp model as Jira teams source. |
9+
| [stg_jira__team](https://fivetran.github.io/dbt_jira/#!/model/model.jira.stg_jira__team) |New Model | | | Added staging model for Jira teams functionality
910
| [jira__timestamp_issue_field_history](https://fivetran.github.io/dbt_jira/#!/model/model.jira.jira__timestamp_issue_field_history) | New Model | | | SCD Type 2 table tracking field changes at timestamp level with validity periods. Each record shows complete field state during a time period with `valid_from`/`valid_until` timestamps. |
1011
| [int_jira__pivot_timestamp_field_history](https://fivetran.github.io/dbt_jira/#!/model/model.jira.int_jira__pivot_timestamp_field_history) | New Model | | | Pivots field history into columns at timestamp level, capturing ALL field changes rather than daily snapshots. |
1112
| [int_jira__timestamp_field_history_scd](https://fivetran.github.io/dbt_jira/#!/model/model.jira.int_jira__timestamp_field_history_scd) | New Model | | | SCD logic that backfills field values at timestamp level, showing complete field state at each update timestamp. |
1213
| [stg_jira__issue_field_history](https://fivetran.github.io/dbt_jira_source/#!/model/model.jira_source.stg_jira__issue_field_history) | New Column | | `author_id` | Tracks which user made each field change for audit trail and change attribution. |
1314
| [stg_jira__issue_multiselect_history](https://fivetran.github.io/dbt_jira_source/#!/model/model.jira_source.stg_jira__issue_multiselect_history) | New Column | | `author_id` | Tracks which user made each multiselect field change for audit trail and change attribution. |
1415
| [jira__timestamp_issue_field_history](https://fivetran.github.io/dbt_jira/#!/model/model.jira.jira__timestamp_issue_field_history) | New Columns | | `author_id`, `status_id`, `is_current_record` | Adds user attribution, raw status ID alongside resolved status name, and current record indicator for SCD Type 2 functionality. |
15-
1616

17+
## Feature Update
18+
- Added support for Jira teams functionality by introducing staging models `stg_jira__team` and `stg_jira__team_tmp`.
19+
- Enhanced issue field history models to include team information if teams are enabled for the customer.
20+
- When teams are enabled, team data will populate in the `jira__daily_issue_field_history` model to track team assignments over time and the `jira__issue_enhanced` model to provide current team assignment for each issue.
21+
22+
## Under the Hood
23+
- Added new seed file `team.csv` for integration testing.
24+
- Added team-related test data to `issue.csv`, `issue_field_history.csv`, and `field.csv` seed files.
25+
- Created `get_team_columns` macro for consistent team column definitions.
26+
- Updated package variables to include team source reference and team identifier configuration.
1727

1828
# dbt_jira v1.0.0
1929

dbt_project.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ vars:
2121
field: "{{ source('jira', 'field') }}"
2222
field_option: "{{ source('jira', 'field_option') }}"
2323
sprint: "{{ source('jira', 'sprint') }}"
24+
team: "{{ source('jira', 'team') }}"
2425
version: "{{ source('jira', 'version') }}"
2526
jira_issue_history_buffer: 1
2627

integration_tests/dbt_project.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ profile: 'integration_tests'
55

66
vars:
77
# Comment out the below when generating docs
8-
issue_field_history_columns: ['summary', 'components'] # @docs-ignore
8+
issue_field_history_columns: ['summary', 'components', 'team'] # @docs-ignore
99

1010
jira:
1111
jira_schema: jira_integrations_tests_42
@@ -30,6 +30,7 @@ vars:
3030
jira_user_group_identifier: "user_group"
3131
jira_user_identifier: "user"
3232
jira_version_identifier: "version"
33+
jira_team_identifier: "team"
3334

3435
models:
3536
jira:

integration_tests/seeds/field.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ issuerestriction,2020-11-23 22:20:39.643,false,false,Restrict to
55
components,2020-11-23 22:20:40.643,false,false,Components
66
summary,2020-11-23 22:20:41.553,false,false,Summary
77
epiclink,2020-11-23 22:20:41.553,false,false,Epic-Link
8-
epic,2020-11-23 22:20:41.553,false,false,Epic
8+
epic,2020-11-23 22:20:41.553,false,false,Epic
9+
customfield_10001,2020-11-23 22:20:41.553,false,true,Team

integration_tests/seeds/issue.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ id,_fivetran_deleted,_fivetran_synced,_original_estimate,_remaining_estimate,_ti
22
10011,FALSE,2020-11-06 22:23:38,,,,,2020-04-01 08:33:58,5c3326c24b248c315badf3ee,"Yes, this is an issue to test permissions",,,10103,TP-8,,,,3,10001,,5c3326c24b248c315badf3ee,,2020-05-29 11:33:53,3,2020-04-01 08:34:02,We want to test permissions,,2020-05-29 11:33:53,-1,10103
33
10015,FALSE,2020-11-06 22:23:41,,,,,2020-06-11 07:38:03,5ed0edbe2999b60c23255b4f,,,,,TP-12,,,,5,10001,,5ed0edbe2999b60c23255b4f,,2020-06-11 07:38:03,10003,2020-06-11 07:38:03,Part of test epic,,2020-06-11 07:38:03,-1,10103
44
10018,FALSE,2020-11-12 12:20:50,,,,,2020-11-10 19:11:45,557058:a9572f6a-3041-435a-96ed-5286e3811b33,,,,10103,TCP-1,2020-11-10 19:11:46,,,3,10005,,557058:a9572f6a-3041-435a-96ed-5286e3811b33,,2020-11-28 19:11:45,10003,2020-11-28 19:11:46,this is a story,,2020-11-28 19:11:45,-1,
5+
10027,FALSE,2020-11-12 12:20:50,,,,,2020-11-15 19:11:45,5ed0edbe2999b60c23255b4f,Test issue to see if teams data populates,,,10103,TP-10,,,,1,10005,,5ed0edbe2999b60c23255b4f,,,3,,just a regular issue,,,,
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
field_id,issue_id,time,_fivetran_synced,value,author_id,is_active
2-
created,10027,2020-11-10 19:19:41.472,2020-11-12 12:20:53.478,2020-11-10T19:19:41.472Z,5e61c1c5c8bee8005f04c88b,true
3-
customfield_10104,10027,2020-11-10 19:19:41.472,2020-11-12 12:20:53.472,3.0,5e61c1c5c8bee8005f04c88b,true
4-
summary,10027,2020-11-10 19:19:41.472,2020-11-12 12:20:53.500,"As a developer, I'd like to update story status during the sprint >> Click the Active sprints link at the top right of the screen to go to the Active sprints where the current Sprint's items can be updated",5e61c1c5c8bee8005f04c88b,true
5-
components,10018,2020-11-10 19:19:41.472,2020-11-19 12:20:53.500,10019,5e61c1c5c8bee8005f04c88c,true
6-
summary,10018,2020-11-10 19:19:41.472,2020-11-19 12:20:53.500,10026,5e61c1c5c8bee8005f04c88c,true
7-
epic,10015,2020-11-10 19:19:41.472,2020-11-19 12:20:53.500,1111111,5e61c1c5c8bee8005f04c88d,true
8-
epiclink,10018,2020-11-10 19:19:41.472,2020-11-12 12:20:53.500,https://ulr-here/epic-key,5e61c1c5c8bee8005f04c88c,true
1+
field_id,issue_id,time,_fivetran_synced,value,is_active,author_id
2+
created,10027,2020-11-10 19:19:41.472,2020-11-12 12:20:53.478,2020-11-10T19:19:41.472Z,true,5e61c1c5c8bee8005f04c88b
3+
customfield_10104,10027,2020-11-10 19:19:41.473,2020-11-12 12:20:53.472,3.0,true,5e61c1c5c8bee8005f04c88b
4+
summary,10027,2020-11-10 19:19:41.474,2020-11-12 12:20:53.500,"As a developer, I'd like to update story status during the sprint >> Click the Active sprints link at the top right of the screen to go to the Active sprints where the current Sprint's items can be updated",true,5e61c1c5c8bee8005f04c88b
5+
components,10018,2020-11-10 19:19:41.475,2020-11-19 12:20:53.501,10019,true,5e61c1c5c8bee8005f04c88c
6+
summary,10018,2020-11-10 19:19:41.476,2020-11-19 12:20:53.502,10026,true,5e61c1c5c8bee8005f04c88c
7+
epic,10015,2020-11-10 19:19:41.477,2020-11-19 12:20:53.503,1111111,true,5e61c1c5c8bee8005f04c88d
8+
epiclink,10018,2020-11-10 19:19:41.478,2020-11-12 12:20:53.504,https://ulr-here/epic-key,true,5e61c1c5c8bee8005f04c88c
9+
customfield_10001,10027,2020-11-10 19:19:41.479,2020-11-12 12:20:53.505,01e9ac93-bccf-4ad2-af92-3317a37ec67b,true,5e61c1c5c8bee8005f04c88c
10+
customfield_10001,10018,2020-11-10 19:19:41.480,2020-11-12 12:20:53.506,1bc241c7-6926-4b46-94b7-82d25069f067,true,5e61c1c5c8bee8005f04c88c
11+
customfield_10001,10015,2020-11-10 19:19:41.481,2020-11-12 12:20:53.507,e74a1782-f463-4542-8440-66de07d4b083,true,5e61c1c5c8bee8005f04c88c
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
_fivetran_id,time,_fivetran_synced,field_id,issue_id,value,author_id,is_active
22
w4UiT+hPMxJp3RhL/YFJm3uWL5U=,2020-11-10 19:19:41.472,2020-11-12 12:20:53.506,subtasks,10027,0,5e61c1c5c8bee8005f04c88b,true
3-
4pVgGn0qSqR2hCmMdo4wWHXmgew=,2020-11-10 19:19:41.472,2020-11-12 12:20:53.479,customfield_10021,10027,0,5e61c1c5c8bee8005f04c88b,true
4-
/zrY8m6q0VMW6ia1jGIerXqLIgQ=,2020-11-10 19:19:41.472,2020-11-12 12:20:53.479,customfield_10020,10027,0,5e61c1c5c8bee8005f04c88b,true
5-
3p3gGn0qSqR2hCmMdo4wWHXa32m=,2020-11-10 19:19:41.472,2020-11-12 12:20:53.479,components,10027,0,5e61c1c5c8bee8005f04c88b,true
3+
4pVgGn0qSqR2hCmMdo4wWHXmgew=,2020-11-10 19:19:42.472,2020-11-12 12:20:53.479,customfield_10021,10027,0,5e61c1c5c8bee8005f04c88b,true
4+
/zrY8m6q0VMW6ia1jGIerXqLIgQ=,2020-11-10 19:19:43.472,2020-11-12 12:20:53.479,customfield_10020,10027,0,5e61c1c5c8bee8005f04c88b,true
5+
3p3gGn0qSqR2hCmMdo4wWHXa32m=,2020-11-10 19:19:44.472,2020-11-12 12:20:53.479,components,10027,0,5e61c1c5c8bee8005f04c88b,true

integration_tests/seeds/team.csv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
id,is_shared,is_visible,name,title,_fivetran_synced
2+
01e9ac93-bccf-4ad2-af92-3317a37ec67b,true,true,HR,HR,2020-11-23 22:20:39.685
3+
891da445-73e5-49b9-9d0d-89f6a587822a,true,true,Cloud Security,Cloud Security,2020-11-23 22:20:39.711
4+
1bc241c7-6926-4b46-94b7-82d25069f067,true,true,People Ops,People Ops,2020-11-23 22:20:39.643
5+
e74a1782-f463-4542-8440-66de07d4b083,true,true,Detection & Response,Detection & Response,2020-11-23 22:20:40.643
6+
d8a8402f-bc1b-4990-9b11-06a52d2de68a,true,true,Platform Security,Platform Security,2020-11-23 22:20:41.553
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% macro get_team_columns() %}
2+
3+
{% set columns = [
4+
{"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
5+
{"name": "id", "datatype": dbt.type_string()},
6+
{"name": "is_shared", "datatype": "boolean"},
7+
{"name": "is_visible", "datatype": "boolean"},
8+
{"name": "name", "datatype": dbt.type_string()},
9+
{"name": "title", "datatype": dbt.type_string()},
10+
] %}
11+
12+
{{ return(columns) }}
13+
14+
{% endmacro %}

0 commit comments

Comments
 (0)