Moving wiki pages that are linkked-to in Jira

M November 8, 2012

In our World (and possibly yours)

  • Jira is what to do
  • Wiki is how to do it.

Each issue in jira has a link to a wiki page describing the spec.

Our products have their own space but we also have one dumpster space called Wikispace that has a number of smaller in-development project pages like our new one ProductX. All the specs go under a header page ProductxPage.

Now I want to move pages under ProductXPage, to a space of its own. However there are many issues in Jira going directly to different pages under the ProductXpage.

1. How do I do this retaining the link in Jira? After moving a test page, the jira link returned a 'page not found' error.

2. How do I even search for the issues in Jira linking to these pages? I can't find them because in Confluence, each page in a space has a unique name rather than a hierarchial name. i.e Not Wikispace/Header Page/ProductXpage/subpage1 but Wikispace/subpage1 so I can't search 'description contains http://wiki/wikispace/headerPage'

Help!

1 answer

0 votes
Ruby Boyarski February 19, 2013

I've copied the answer for your second question from my own question, which is very similar: https://answers.atlassian.com/questions/138741/how-can-i-find-jira-issues-that-are-linkes-to-a-specific-confluence-page

Here's the code in the getQuery method of the scripted JQL function (you essentially put any SQL statement there that returns issue ids) - I called it "linkedToPage"

Query getQuery(QueryCreationContext queryCreationContext, FunctionOperand operand, TerminalClause terminalClause) {   
	ComponentManager componentManager = ComponentManager.getInstance()
	def delegator = (DelegatorInterface) componentManager.getComponentInstanceOfType(DelegatorInterface.class)
	String helperName = delegator.getGroupHelperName("default");

	def sqlStmt = """select issueid from remotelink where url = 'https://YOUR_CONFLUENCE_DOMAIN/pages/viewpage.action?pageId=""" + operand.args[0] + """'"""

	Connection conn = ConnectionFactory.getConnection(helperName);
	Sql sql = new Sql(conn)
	def booleanQuery = new BooleanQuery()
	sql.eachRow(sqlStmt) {
                booleanQuery.add(new TermQuery(new Term("issue_id", "${it.issueid}")), BooleanClause.Occur.SHOULD)
	}
	return booleanQuery
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events