Skip to content

Commit

Permalink
fix(jira): escape summary characters correctly
Browse files Browse the repository at this point in the history
The regex was wrong

Fixes #549
  • Loading branch information
tagoro9 committed Jul 9, 2020
1 parent 7b65a63 commit 7a48209
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/issue-tracker/jira/Jira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export class Jira implements Tracker {
replace(/([_-])$/, ''),
replace(/\s|\(|\)|__+/g, '_'),
replace(/\/|\.|--=/g, '-'),
replace(/["$&'*,:<>?@[]`~‘’“”]/g, ''),
replace(/["$&'*,:;<>?@[\]`~‘’“”]/g, ''),
toLower,
)(issue.fields.summary),
summary: issue.fields.summary,
Expand Down
13 changes: 13 additions & 0 deletions test/issue-tracker/__snapshots__/Jira.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,16 @@ Object {
"message": "There was an error",
}
`;

exports[`jira getIssue gets and transforms the issue from Jira 1`] = `
Object {
"description": undefined,
"id": 2928,
"key": "FOTINGO-4266",
"project": "soluta",
"sanitizedSummary": "issue_with_a_lot_of_characters",
"summary": "Issue with a lot of characters \\"$&'*,:;<>?@[]\`~‘’“”",
"type": "Story",
"url": "https://vallie.biz/browse/FOTINGO-4266",
}
`;

0 comments on commit 7a48209

Please sign in to comment.