Moving wiki pages that are linkked-to in Jira

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'


1 answer

I've copied the answer for your second question from my own question, which is very similar:

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
Community showcase
Published Tuesday in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

204 views 2 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you