########################################################################################## JILS-45: Add support for moved issues ########################################################################################## Issue Type: New Feature ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Done (2016-04-29 14:45:24) Project: Jira Issue Listing Script (JILS) Reported By: btasker Assigned To: btasker Affected Versions: - 0.1 - 0.01b Targeted for fix in version: - 0.1 - 0.01b Time Estimate: 48 minutes Time Logged: 72 minutes ----------------------------------------------------------------------------------------- Issue Description ================== Currently if an issue is moved from a non-public project into a public one, any self-references it contains will result in a 404. Similarly any references to it from other public issues will also 404 (though "Links" will automatically update). To work around this, I want to introduce support for JIRAs moved issues functionality - that is, generate a page for that issue (regardless of whether it's parent project is public) which redirects the user to the new issue. The original issue key as well as the ID of the new issue can be obtained from the table moved\_issue\_key -- BEGIN SNIPPET -- mysql> describe moved_issue_key; +---------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------+------+-----+---------+-------+ | ID | decimal(18,0) | NO | PRI | NULL | | | OLD_ISSUE_KEY | varchar(255) | YES | UNI | NULL | | | ISSUE_ID | decimal(18,0) | YES | | NULL | | +---------------+---------------+------+-----+---------+-------+ -- END SNIPPET -- We're going to want to limit result sets to only retrieve matches where the *new* project is accessible by the user. A page should be generated (under browse) which details that the page has been moved and attempts a JS redirect to the new page (providing a link for those who don't have JS enabled). Also need to look at whether there's a good way to indicate to Google that the page has moved (can't send a 301/302 as it'll break sites created with a mirror script). ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2016-04-29 12:39:31 btasker ----------------------------------------------------------------------------------------- I've marked this affecting both versions 0.1 and 0.01b - I want this functionality active sooner rather than later, and I suspect 0.1 is a little way off release, so want to backport the changes into 0.01b ----------------------------------------------------------------------------------------- 2016-04-29 12:44:50 ----------------------------------------------------------------------------------------- btasker changed status from 'Open' to 'In Progress' ----------------------------------------------------------------------------------------- 2016-04-29 12:49:12 btasker ----------------------------------------------------------------------------------------- Need to tab project filters on the end, but the SQL to generate a list of all moved issues (with information about their destination) is -- BEGIN SNIPPET -- SELECT a.OLD_ISSUE_KEY, b.pname, b.pkey, ji.issuenum FROM `moved_issue_key` AS a LEFT JOIN jiraissue AS ji ON a.ISSUE_ID = ji.ID LEFT JOIN project AS b on ji.PROJECT = b.ID -- END SNIPPET -- ----------------------------------------------------------------------------------------- 2016-04-29 13:10:20 btasker ----------------------------------------------------------------------------------------- I've started implementing the changes on 0.01b first as I think it'll be easier to move the changes forward to 0.1 than backwards (given the changes in file structure etc). Commit 8072935 introduces an index page for all moved issues (required for the wget mirror to work) ----------------------------------------------------------------------------------------- 2016-04-29 13:11:27 git ----------------------------------------------------------------------------------------- -- BEGIN QUOTE -- Repo: Jira-Issue-Listing Commit: 80729352308cec2e379c9fb2c189831ce67d3f5e Author: Ben Tasker