@@ -112,10 +112,9 @@ def test_get_create_issue_config(self):
112112 "name" : "project" ,
113113 "default" : "10000" ,
114114 "updatesForm" : True ,
115- "choices" : [("10000" , "EX - Example " ), ("10001" , "ABC - Alphabetical " )],
115+ "choices" : [("10000" , "EX" ), ("10001" , "ABC" )],
116116 "label" : "Jira Project" ,
117117 "type" : "select" ,
118- "required" : True ,
119118 },
120119 {
121120 "default" : "message" ,
@@ -209,81 +208,6 @@ def test_get_create_issue_config(self):
209208 },
210209 ]
211210
212- @responses .activate
213- @with_feature ("organizations:jira-paginated-projects" )
214- def test_get_create_issue_config_paginated_projects (self ):
215- """Test that projects are fetched using pagination when the feature flag is enabled"""
216- event = self .store_event (
217- data = {
218- "event_id" : "a" * 32 ,
219- "message" : "message" ,
220- "timestamp" : self .min_ago ,
221- },
222- project_id = self .project .id ,
223- default_event_type = EventType .DEFAULT ,
224- )
225- group = event .group
226- assert group is not None
227-
228- # Mock the paginated projects response
229- responses .add (
230- responses .GET ,
231- "https://example.atlassian.net/rest/api/2/project/search" ,
232- json = {
233- "values" : [
234- {"id" : "10000" , "key" : "PROJ1" , "name" : "Project 1" },
235- {"id" : "10001" , "key" : "PROJ2" , "name" : "Project 2" },
236- ],
237- "total" : 2 ,
238- },
239- )
240-
241- # Mock the create issue metadata endpoint
242- responses .add (
243- responses .GET ,
244- "https://example.atlassian.net/rest/api/2/issue/createmeta" ,
245- json = {
246- "projects" : [
247- {
248- "id" : "10000" ,
249- "key" : "PROJ1" ,
250- "name" : "Project 1" ,
251- "issuetypes" : [
252- {
253- "description" : "An error in the code" ,
254- "fields" : {
255- "issuetype" : {
256- "key" : "issuetype" ,
257- "name" : "Issue Type" ,
258- "required" : True ,
259- }
260- },
261- "id" : "bug1" ,
262- "name" : "Bug" ,
263- }
264- ],
265- }
266- ]
267- },
268- )
269-
270- installation = self .integration .get_installation (self .organization .id )
271- fields = installation .get_create_issue_config (group , self .user )
272-
273- # Find the project field in the config
274- project_field = next (field for field in fields if field ["name" ] == "project" )
275-
276- # Verify the project field is configured correctly
277- assert (
278- project_field ["url" ]
279- == f"/extensions/jira/search/{ self .organization .slug } /{ self .integration .id } /"
280- )
281- assert project_field ["choices" ] == [
282- ("10000" , "PROJ1 - Project 1" ),
283- ("10001" , "PROJ2 - Project 2" ),
284- ]
285- assert project_field ["type" ] == "select"
286-
287211 def test_get_create_issue_config_customer_domain (self ):
288212 event = self .store_event (
289213 data = {
@@ -441,12 +365,11 @@ def test_get_create_issue_config_with_default_and_param(self):
441365
442366 assert project_field == {
443367 "default" : "10000" ,
444- "choices" : [("10000" , "EX - Example " ), ("10001" , "ABC - Alphabetical " )],
368+ "choices" : [("10000" , "EX" ), ("10001" , "ABC" )],
445369 "type" : "select" ,
446370 "name" : "project" ,
447371 "label" : "Jira Project" ,
448372 "updatesForm" : True ,
449- "required" : True ,
450373 }
451374
452375 def test_get_create_issue_config_with_default (self ):
@@ -475,12 +398,11 @@ def test_get_create_issue_config_with_default(self):
475398
476399 assert project_field == {
477400 "default" : "10001" ,
478- "choices" : [("10000" , "EX - Example " ), ("10001" , "ABC - Alphabetical " )],
401+ "choices" : [("10000" , "EX" ), ("10001" , "ABC" )],
479402 "type" : "select" ,
480403 "name" : "project" ,
481404 "label" : "Jira Project" ,
482405 "updatesForm" : True ,
483- "required" : True ,
484406 }
485407
486408 @patch ("sentry.integrations.jira.integration.JiraIntegration.fetch_issue_create_meta" )
@@ -525,12 +447,11 @@ def test_get_create_issue_config_with_default_project_deleted(
525447
526448 assert project_field == {
527449 "default" : "10001" ,
528- "choices" : [("10000" , "EX - Example " ), ("10001" , "ABC - Alphabetical " )],
450+ "choices" : [("10000" , "EX" ), ("10001" , "ABC" )],
529451 "type" : "select" ,
530452 "name" : "project" ,
531453 "label" : "Jira Project" ,
532454 "updatesForm" : True ,
533- "required" : True ,
534455 }
535456
536457 def test_get_create_issue_config_with_label_default (self ):
0 commit comments