Skip to content

Commit

Permalink
Merge pull request #7 from windmilleng/nicks/specialchars
Browse files Browse the repository at this point in the history
remove special characters from title when searching. fixes #6
  • Loading branch information
nicks committed Apr 10, 2020
2 parents 652aa58 + 52caadc commit ff68159
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ function findClubhouseStoryForGithubIssue(issue) {
// https://github.com/clubhouse/clubhouse-lib/issues/23
// https://github.com/clubhouse/clubhouse-lib/issues/70
let title = issue.title
return ch.searchStories(title).then(response => {

// Remove special characters from the title in case they
// are search operators.
let simplifiedTitle = title.replace(/[^a-zA-Z]/gi, ' ')

return ch.searchStories(simplifiedTitle).then(response => {
let stories = response.data
return stories.find(story => {
let links = story.external_tickets || []
Expand Down

0 comments on commit ff68159

Please sign in to comment.