@@ -346,7 +346,9 @@ export class GithubHelper {
346346 let bodyConverted = await this . convertIssuesAndComments (
347347 issue . description ?? '' ,
348348 issue ,
349- ! this . userIsCreator ( issue . author ) || ! issue . description
349+ ! this . userIsCreator ( issue . author ) || ! issue . description ,
350+ true ,
351+ true ,
350352 ) ;
351353
352354 let props : RestEndpointMethodTypes [ 'issues' ] [ 'create' ] [ 'parameters' ] = {
@@ -460,7 +462,9 @@ export class GithubHelper {
460462 : await this . convertIssuesAndComments (
461463 issue . description ?? '' ,
462464 issue ,
463- ! this . userIsCreator ( issue . author ) || ! issue . description
465+ ! this . userIsCreator ( issue . author ) || ! issue . description ,
466+ true ,
467+ true ,
464468 ) ;
465469
466470 let props : IssueImport = {
@@ -985,7 +989,10 @@ export class GithubHelper {
985989 if ( canCreate ) {
986990 let bodyConverted = await this . convertIssuesAndComments (
987991 mergeRequest . description ,
988- mergeRequest
992+ mergeRequest ,
993+ true ,
994+ true ,
995+ true ,
989996 ) ;
990997
991998 // GitHub API Documentation to create a pull request: https://developer.github.com/v3/pulls/#create-a-pull-request
@@ -1027,7 +1034,9 @@ export class GithubHelper {
10271034 let bodyConverted = await this . convertIssuesAndComments (
10281035 mergeStr + mergeRequest . description ,
10291036 mergeRequest ,
1030- ! this . userIsCreator ( mergeRequest . author ) || ! settings . useIssueImportAPI
1037+ ! this . userIsCreator ( mergeRequest . author ) || ! settings . useIssueImportAPI ,
1038+ true ,
1039+ true ,
10311040 ) ;
10321041
10331042 if ( settings . useIssueImportAPI ) {
@@ -1284,12 +1293,15 @@ export class GithubHelper {
12841293 * @param str Body of the GitLab note
12851294 * @param item GitLab item to which the note belongs
12861295 * @param add_line Set to true to add the line with author and creation date
1296+ * @param add_line_ref Set to true to add the line ref to the comment
1297+ * @param add_issue_information Set to true to add assignees, reviewers, and approvers
12871298 */
12881299 async convertIssuesAndComments (
12891300 str : string ,
12901301 item : GitLabIssue | GitLabMergeRequest | GitLabNote | MilestoneImport | GitLabDiscussionNote ,
12911302 add_line : boolean = true ,
12921303 add_line_ref : boolean = true ,
1304+ add_issue_information : boolean = false ,
12931305 ) : Promise < string > {
12941306 // A note on implementation:
12951307 // We don't convert project names once at the beginning because otherwise
@@ -1464,6 +1476,11 @@ export class GithubHelper {
14641476 this . gitlabHelper
14651477 ) ;
14661478
1479+ if ( add_issue_information && settings . conversion . addIssueInformation ) {
1480+ let issue = item as GitLabIssue ;
1481+ str = await this . addIssueInformation ( issue , str )
1482+ }
1483+
14671484 if ( 'web_url' in item ) {
14681485 str += '\n\n*Migrated from GitLab: ' + item . web_url + '*' ;
14691486 }
@@ -1564,6 +1581,26 @@ export class GithubHelper {
15641581 return lineRef ;
15651582 }
15661583
1584+ async addIssueInformation ( issue : GitLabIssue | GitLabMergeRequest , description : string ) : Promise < string > {
1585+ let bodyConverted = description ;
1586+
1587+ let assignees = issue . assignees . map ( a => a . username ) as string [ ] ;
1588+ bodyConverted += utils . organizationUsersString ( assignees , "Assignees" ) ;
1589+
1590+ // check whether issue is of type GitLabMergeRequest
1591+ if ( issue . reviewers ) {
1592+ let mergeRequest = issue as GitLabMergeRequest ;
1593+
1594+ let mrReviewers = mergeRequest . reviewers . map ( a => a . username ) as string [ ] ;
1595+ bodyConverted += utils . organizationUsersString ( mrReviewers , 'Reviewers' ) ;
1596+
1597+ let approvals = await this . gitlabHelper . getMergeRequestApprovals ( mergeRequest . iid ) ;
1598+ bodyConverted += utils . organizationUsersString ( approvals , 'Approved by' ) ;
1599+ }
1600+
1601+ return bodyConverted ;
1602+ }
1603+
15671604 /**
15681605 * Meh...
15691606 * @param milestoneMap
0 commit comments