getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.19k stars 4.2k forks source link

Unable to fill in the "Reporter" section when using the Jira Issue tracking option. #67134

Open rquadling opened 8 months ago

rquadling commented 8 months ago

Environment

SaaS (https://sentry.io/)

What are you trying to accomplish?

Validate the link between Sentry.IO and Jira by creating a ticket.

To achieve this, I have created an API Token on my Jira account (I'm one of the admins).

The Sentry.IO page I used is https://digitickets.sentry.io/settings/projects/ticketing-backend/plugins/jira/

On that page, I've entered all the details and the Sentry.IO page correctly shows me a list of Jira projects to link up with.

From what I can tell, all the questions have been answered correctly.

How are you getting stuck?

On a ticket page, we have the "Jira Issue" button under the "Issue Tracking" section in the right hand panel.

image

Selecting that give me a "Jira Issue" dialog, which has the Sentry.IO's content and the Jira Project correctly selected.

In the Reporter section at the top of the dialog, I'm told to "Start typing to search for a user".

So I start typing my name.

And I get an error message popup in the bottom right hand corner.

image

In looking at the Jira plugin code, specifically these lines:

https://github.com/getsentry/sentry/blob/master/src/sentry_plugins/jira/client.py#L28 and https://github.com/getsentry/sentry/blob/master/src/sentry_plugins/jira/client.py#L81, in addition to the Jira API documentation regarding the mentioned URL, and then building a curl request using the API token that's stored in Sentry.IO ...

Without the username= search:

$ curl --request GET --silent --url 'https://*****.atlassian.net/rest/api/2/user/assignable/search?project=BC' --user 'richard.quadling@*****.co.uk:ATATT3x*****=D54A9C0F' --header 'Accept: application/json' | jq '.[].displayName' | cut -c 1-8 | head
"Abigail
"Adam Je
"Adrian 
"Alina B
"Andrew 
"Andrew 
"Angela 
"Anthony
"Automat
"Barnaby

All working as expected.

If I now add in the username= search.

$ curl --request GET --silent --url 'https://*****.atlassian.net/rest/api/2/user/assignable/search?project=BC&username=R' --user 'richard.quadling@*****.co.uk:ATATT3x*****=D54A9C0F' --header 'Accept: application/json' | jq .
{
  "errorMessages": [
    "The query parameter 'username' is not supported in GDPR strict mode."
  ],
  "errors": {}
}

As we are in the UK which has GDPR regulations, the username= parameter for the API is no longer supported.

But, as in all things, someone, somehow, within Jira now has a different parameter that can work.

$ curl --request GET --silent --url 'https://*****.atlassian.net/rest/api/2/user/assignable/search?project=BC&query=A' --user 'richard.quadling@*****.co.uk:ATATT3x*****=D54A9C0F' --header 'Accept: application/json' | jq '.[].displayName' | cut -c 1-8 | head
"Abigail
"Adam Je
"Adrian 
"Alina B
"Andrew 
"Andrew 
"Angela 
"Anthony
"Automat

Here, all the A's have been shown. Sadly, Barnaby didn't make the cut!

So, in theory, to fix this issue and NOT break the plugin for non-EU members, a 1 word change from

    def search_users_for_project(self, project, username):
        return self.get(self.USERS_URL, params={"project": project, "username": username})

to

    def search_users_for_project(self, project, username):
        return self.get(self.USERS_URL, params={"project": project, "query": username})

at https://github.com/getsentry/sentry/blob/master/src/sentry_plugins/jira/client.py#L81 could be enough.

But then, the tests for the plugin, that I assume is currently passing, are not running in the EU, and so do not fall foul of the GDPR rules.

The one use of username= WITH a username is https://github.com/getsentry/sentry/blob/master/tests/sentry_plugins/jira/test_plugin.py#L296. The 2 other usages of username= do NOT have a username attached (but I didn't check too deeply to see if a username is added later in the test).

Where in the product are you?

Settings - Integrations

Link

https://digitickets.sentry.io/issues/5054482567/?project=4506857852567552&query=&referrer=project-issue-stream

DSN

No response

Version

No response

getsantry[bot] commented 8 months ago

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] commented 8 months ago

Routing to @getsentry/product-owners-issues for triage ⏲️

jangjodi commented 8 months ago

Hi @rquadling, Unfortunately our Jira plugin is unmaintained, but if you use our Jira integration instead, the GDPR regulations are handled there. Here are the docs for setting up the Jira integration.