Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join to Component when there are multiple components on jira__daily_issue_field_history #123

Open
2 of 4 tasks
abrown-calix opened this issue Mar 22, 2024 · 1 comment
Open
2 of 4 tasks

Comments

@abrown-calix
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

In our organization we can have multiple components for one jira story. We added component to our list of columns we want to see in the dbt_project.yml issue_field_history_columns variable and it seems to work up to a point. In reviewing the jira__daily_issue_field_history there is a join in the set_values CTE where it does not account for the fact we can have multiple values. If we could add the join further up stream to get the correct values that would be greatly beneficial.

Relevant error log or model output

As a work around we have had to 
- flatten the components column from the jira__issue_enhanced dbt model
- then join to stg_jira__component to get the actual name of the component
- then listagg the name partitioning by the issue_id

`with test as (
SELECT trim(f.value) as component_id, a.* --f.value as component_id_new, a.*
FROM ANALYTICS.JIRA.JIRA_ISSUE a,
LATERAL SPLIT_TO_TABLE(a.components, ',') f
WHERE ISSUE_ID IN (948017,
                   925164)
)

select a.issue_id
   ,a.components
    ,a.component_id
    ,b.component_name
    ,coalesce(b.component_name, a.component_id) as new_component_name
from test a
left join analytics.stg.stg_jira__component b on a.component_id = b.component_id::varchar
;  `

![image](https://github.com/fivetran/dbt_jira/assets/127148173/7482fee9-7a99-4807-a8a9-40589ebbc94d)

Thanks!

Expected behavior

That the components all are the names of the components and not just those where a story has one component listed

dbt Project configurations

issue_field_history_columns: ['Story Points','Summary','Components']

Package versions

version: 0.15.0

What database are you using dbt with?

snowflake

dbt Version

1.7.9

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.
@fivetran-reneeli
Copy link
Contributor

fivetran-reneeli commented Mar 25, 2024

Hi @abrown-calix ,thanks for opening this. I'm understanding that you wish to be able to bring multiple values that can be tied to a Jira entity through in the model. This is a limitation that we're aware of and we have a Feature Request opened here that you may follow.

Thanks for sharing your workaround! I see you're open to creating a PR, we welcome that! Let me know if you have other notes you'd like to share.

-- 4/1/24 update-- corrected the link pointing to the relevant FR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants