Is it possible to base Confluence page URLs on numbers, not page titles?
Asked by Susan Parker:

We would like to link our CRM up to Confluence pages that contain overviews of each customer account; it would be great if the end of the URL string could be the customer account number, not the page title. (We'd like the page title to be the name of the customer.)


Answers:
author: Midori
body: You can do this dead-simple workaround with labels:

1. If your customer has the ID=12345 in the CRM, then add the label "12345" to the corresponding Confluence page. If it'd conflict with your existing label, then use labels like "crm-12345".
2. Now you can search for the label name via the URL: \<YOUR_CONFLIENCE_BASE_URL\>/dosearchsite.action?queryString=12345

The first and only hit should be your customer's page.

comments: author: Susan Parker
body: Thanks! Actually the pages each contain the customer number so a label isn't necessary to produce the same result. But you got me thinking and I played around with Confluence search and discovered the following ways to build on this suggestion and narrow down the results: 1) limit to searching within the space; 2) search specifically for the tag - as follows:\<MY-CONFLUENCE-BASE-URL\>/dosearchsite.action?queryString=labelText%3A177128\&startIndex=0\&where=\<MY-SPACEKEY\>... So this narrows it down to one hit (provided no other pages use the customer number as a tag). Unfortunately, it's still an extra click - but much closer to what I'm looking for. Thanks again.


author: Peter Van de Voorde
body: Hi Susan,

No this is not possible.

Best regards,

Peter

comments: author: Susan Parker
body: Okayyy. Any ideas as to an *alternative* means of achieving a similar result?   
For example - I found a plugin that provides macros for redirects and aliases, but it is not available for Cloud instances of Confluence. Or perhaps we could make the URL coming from the CRM be a search string - like "[https://XYZ.atlassian.net/wiki/dosearchsite.action?queryString=177128"](https://laddawn1.atlassian.net/wiki/dosearchsite.action?queryString=177128) - this will not bring you directly to the page unfortunately.


author: Peter Van de Voorde
body: Just wondering: why do you want the url to contain this kind of information?Isn't the content of the Confluence page way more important than the url that leads towards it?Would anybody be actually looking at the url for this kind of information?Best regards,Peter


author: Susan Parker
body: You're preaching to the choir concerning content. No, no one would actually be looking at the URL. What I am trying to accomplish is a means of linking to Confluence pages, from a proprietary CRM database that keys off of customer account numbers as the enduring, unique identifier. We would have one Confluence page for every unique customer. I could potentially have our CRM programmers automate the generation of these URLS if based on customer account numbers. It's not so easy with page titles - it's challenging and problematic to ensure page titles created by Confluence end users match exactly the customer title in our data base. Also, the company names may change over time - links within Confluence will work but external ones will not. Thanks.


author: Susan Parker
body: The alternative is to use the account number as the page title, so that they would be in the URL - to your point, not very intuitive or useful as content, particularly if you want a scannable, alphabetized index of customers. The other alternative is to create the pages and manually enter URLs into the CRM (and fix them when they break).


author: Peter Van de Voorde
body: Hi Susan,Each page in Confluence also has a pageId you could use to link it (\<your-server\>/pages/viewpage.action?pageId=26510005) for example. So maybe you could do something with those but I'm not sure how they are generated.You could also try to do something with the rest interface and let your developers use it to automatically create a page and then return you the url to this page to add to the CRM database? More information about the Confluence rest interface can be found here : <https://developer.atlassian.com/confdev/confluence-rest-api/confluence-rest-api-examples#ConfluenceRESTAPIExamples-Createanewpage>Best regards,Peter


Tags: cloud

confluence-cloud

url