Sentry: [Jira Server] Configurable Default Jira Project per Sentry Project

Created on 8 May 2019  路  8Comments  路  Source: getsentry/sentry

Hi,

currently, when I create a new Jira ticket via Sentry, I have to choose the Jira project. It would save some time and prevent human errors, if this field could have a default, configurable per Sentry project. This would make sure that the Jira tickets are always in the correct Jira project.

Integrations

All 8 comments

The new Jira integration should remember the last used jira project, is that not happening for you?

Thank you for the quick answer.
It is but this is a bit unconvinient for us:
As an agency, we have many projects and when I wade through Sentry, the last used Jira project is outdated. And when I revisit Sentry the next day, the last Jira project isn't remembered anymore.
And this doesn't prevent human errors as good as a setting it per Sentry project.

The new Jira integration should remember the last used jira project, is that not happening for you?

@markstory : I think if you use the "Link" tab, it resets all of the saved fields the next time you use the "Create" tab
image

I think the issue is that ideally installation.store_issue_last_defaults(...) should only get called if created == True in:

https://github.com/getsentry/sentry/blob/6589c16bdb8a2362c2e7eed52adec70acd500d3a/src/sentry/api/endpoints/group_integration_details.py#L138

If this seems correct. I'd be happy to submit a PR... but would take me to time to actually work through it since I've never contributed to Sentry before.

@saifelse sounds correct to me. Are you able to test it locally with your patch? Once you submit a PR we can get you a built Docker image if that'd make your life easy.

@saifelse still interested?

@BYK : Whoops, sorry I missed your message in February. I was able to get a dev environment setup, so will have a PR coming your way shortly!

@BYK: I took a different approach in the PR. When taking a closer look at the code, it appears that store_issue_last_defaults explicitly states that it is used for storing defaults for both link/create: https://github.com/getsentry/sentry/blob/36c577ad09ec47d66e3d9d9885c13fd8a7aaae74/src/sentry/integrations/issues.py#L97-L111

From testing with Jira Cloud, I found that in the create flow, data was the full set of configured values, while for link, data was empty. Based on how the code is structured, it seems possible that the create and link could theoretically both have fields that are overlapping or even disjoint. To address this, I fixed store_issue_last_defaults to merge values instead of overwirte.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Leroygirl picture Leroygirl  路  3Comments

fatagun picture fatagun  路  4Comments

chavlin picture chavlin  路  3Comments

codekitchen picture codekitchen  路  3Comments

nickolaskraus-wf picture nickolaskraus-wf  路  3Comments