@@ -60,7 +60,7 @@ def bug_create_or_update(
60
60
self , payload : BugzillaWebhookRequest
61
61
): # pylint: disable=too-many-locals
62
62
"""Create and link jira issue with bug, or update; rollback if multiple events fire"""
63
- linked_issue_key = payload . bug .extract_from_see_also () # type: ignore
63
+ linked_issue_key = getbug_as_bugzilla_object ( payload ) .extract_from_see_also () # type: ignore
64
64
if linked_issue_key :
65
65
# update
66
66
fields , comments = payload .map_as_tuple_of_field_dict_and_comments ()
@@ -84,7 +84,14 @@ def bug_create_or_update(
84
84
85
85
def create_and_link_issue (self , payload ):
86
86
"""create jira issue and establish link between bug and issue; rollback/delete if required"""
87
- fields = {** payload .bug .map_as_jira_issue (), "key" : self .jira_project_key } # type: ignore
87
+ comment_list = self .bugzilla_client .get_comments (idlist = [payload .bug .id ])
88
+ fields = {
89
+ ** payload .bug .map_as_jira_issue (), # type: ignore
90
+ "description" : comment_list ["bugs" ][str (payload .bug .id )]["comments" ][0 ][
91
+ "text"
92
+ ],
93
+ "project" : {"key" : self .jira_project_key },
94
+ }
88
95
89
96
jira_response_create = self .jira_client .create_issue (fields = fields )
90
97
@@ -114,11 +121,11 @@ def create_and_link_issue(self, payload):
114
121
)
115
122
return {"status" : "duplicate" , "jira_response" : jira_response_delete }
116
123
# else:
117
- jira_url = self .settings .jira_issue_url . format ( jira_key_in_response )
124
+ jira_url = self .settings .jira_issue_url % jira_key_in_response
118
125
update = self .bugzilla_client .build_update (see_also_add = jira_url )
119
126
bugzilla_response = self .bugzilla_client .update_bugs ([bug_obj .id ], update )
120
127
121
- bugzilla_url = self .settings .bugzilla_bug_url . format ( bug_obj .id )
128
+ bugzilla_url = self .settings .bugzilla_bug_url % bug_obj .id
122
129
jira_response = self .jira_client .create_or_update_issue_remote_links (
123
130
issue_key = jira_key_in_response ,
124
131
link_url = bugzilla_url ,
0 commit comments