Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate tasks in JIRA #157

Open
ghost opened this issue Apr 2, 2019 · 7 comments
Open

Duplicate tasks in JIRA #157

ghost opened this issue Apr 2, 2019 · 7 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 2, 2019

Description
Tasks are created in the JIRA system, but the filter that eliminates duplication does not work. Duplicates are created because the jql query is incorrect and incorrectly verified by the "fingerprint".

Proposed solution
I found a working solution.
https://community.atlassian.com/t5/Jira-questions/CONTAINS-does-not-seem-to-work-when-searching-description/qaq-p/408602
I tested this solution on local machine and it's working.

@ghost
Copy link
Author

ghost commented Apr 7, 2019

The problem is the wrong symbol "_" in the fingerprints.
The CONTAINS (~) operator incorrectly supports fingerprint.

Maybe, remove the "_" symbol from the fingeprint (by changing the jq instruction
"fingerprint": "\ ($ in.pluginid) _ \ ($ h.uri) _ \ ($ h.method)" on
"fingerprint": "\ ($ in.pluginid) \ ($ h.uri) \ ($ h.method)"

@omerlh What do you think about such an idea?

@omerlh
Copy link
Collaborator

omerlh commented Apr 8, 2019

Sounds good! Seems like there is no need for a PR, right?

@ghost
Copy link
Author

ghost commented Apr 9, 2019

@omerlh Unfortunately, the solution does not work. The jql filter is incorrect.
I made the test.

Actual jql query
zrzut1

Modify jql query (based on https://community.atlassian.com/t5/Jira-questions/CONTAINS-does-not-seem-to-work-when-searching-description/qaq-p/408602)
Below is an example output :
zrzut2
I hope you understand :-), the current filter does not find any tasks and duplicates are created.
I think the error is in the file glue / lib / glue / filters / jira_one_time_filter.rb (line 46).
I would like to implement Glue productively, and correct reporting is very important, so I am asking for PR.

@omerlh
Copy link
Collaborator

omerlh commented Apr 10, 2019

Will you able to contribute this PR?

@ghost
Copy link
Author

ghost commented Apr 10, 2019

I will try :-), but I will need help with modification
/glue/lib/glue/filters/jira_one_time_filter.rb:46.

I changed
jira.Issue.jql ("project = # {@ project} AND description ~ '# {finding.fingerprint}' AND resolution is EMPTY '). each to | issue |

on
jira.Issue.jql ("project = # {@ project} AND description ~ '"\"#{finding.fingerprint}\""' AND resolution is EMPTY"). each to | issue |

I tried this way, but I get the error:

/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:117:in `require': /glue/lib/glue/filters/jira_one_time_filter.rb:46: syntax error, unexpected $undefined, expecting ')' (SyntaxError)
project} AND description ~ '"\"#{finding.fingerprint}\""' AN
                              ^
/glue/lib/glue/filters/jira_one_time_filter.rb:46: unterminated string meets end of file
/glue/lib/glue/filters/jira_one_time_filter.rb:46: syntax error, unexpected end-of-input, expecting keyword_end
	from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:117:in `require'
	from /glue/lib/glue/filters.rb:40:in `block in <top (required)>'
	from /glue/lib/glue/filters.rb:39:in `each'
	from /glue/lib/glue/filters.rb:39:in `<top (required)>'
	from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from /glue/lib/glue.rb:248:in `scan'
	from /glue/lib/glue.rb:47:in `run'
	from bin/glue:58:in `<main>'

@omerlh
Copy link
Collaborator

omerlh commented Apr 10, 2019

Let's move to OWASP slack, it will be faster - feel free to ping me there :)

@stale
Copy link

stale bot commented Jun 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant