Created
June 13, 2022 13:45
-
-
Save stelf/83cdffdef4d6362679fabae51dde6cf6 to your computer and use it in GitHub Desktop.
Oracle PLSQL: JIRA identifiers clowd matched against ticket keys (for analysis)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT distinct | |
upper(CAST (keywords.str AS varchar2(32))) AS keyword, | |
JP.pkey || '-' || JI.issuenum AS issuekey | |
FROM | |
JIRAACTION jA | |
JOIN jiraissue JI ON | |
JA.issueid = JI.id | |
JOIN project JP ON | |
JI.project = JP.id | |
CROSS JOIN lateral | |
(SELECT | |
regexp_substr(ja.actionbody, '(^|\s)(\w+_\w+)($|\s)', 1, LEVEL, NULL, 2) str | |
FROM | |
dual | |
CONNECT BY | |
LEVEL <= regexp_count(ja.actionbody,'(^|\s)\w+_\w+($|\s)') | |
ORDER BY LEVEL ASC | |
) keywords | |
WHERE | |
JA.actiontype = 'comment' | |
AND REGEXP_LIKE(JA.actionbody, '(^|\s)\w+_\w+($|\s)') | |
AND NOT regexp_like(keywords.str, '^_+$') | |
-- AND rownum < 400 | |
ORDER BY issuekey |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment