Search code examples
azureurlazure-devopsazure-devops-wiki

What is the URL for New Page in Azure DevOps Wiki? / How to bookmark New Page?


Is there a URL for New Page in Azure DevOps Wiki?

Specifically one where I can specify the path that it will create the new page in.

I know that if you wanted to bookmark the link to view a specific page you'd usually need to know the page ID, E.G. 22 in this link:

https://dev.azure.com/incredibleit/Incredible%20IT/_wiki/wikis/Incredible-IT.wiki/22/Backups-Restores

However there is a "secret link" you can use to specify the path instead, when the page ID is unknown:

https://dev.azure.com/incredibleit/Incredible%20IT/_wiki/wikis/Incredible-IT.wiki?pagePath=/Home/Technical/Important/Backups%20%26%20Restores

And to edit a page at a specified path it's:

https://dev.azure.com/incredibleit/Incredible%20IT/_wiki/wikis/Incredible-IT.wiki?wikiVersion=GBwikiMaster&_a=edit&pagePath=/Home/Technical/Important/Backups%20%26%20Restores

I tried modifying that last URL from &_a=edit to &_a=new and &a_=add but neither worked.

How can I link to New Page / New Subpage for a specified path?

When I click New Page from within DevOps Wiki, the URL in the address bar does not change.

This is for a larger project that automatically builds Sphinx Docs () from an Azure DevOps Wiki. I'd like the ability to have a New button in Sphinx. Currently I've managed to add "View on Wiki" and "Edit on Wiki" buttons to each page, along with a few more that are not Wiki-related - and I'm looking to add "New page" to it... but essentially my question boils down: what is the URL for New page at a specified path?

Here's what each page looks like in Sphinx:

I checked the event listeners on the New Page button in DevOps Wiki but from what I saw it links to an empty function called we()

If you're interested: I'm using to auto-build Sphinx from the Wiki each time an edit is made, and the HTML of each page gets customised by some scripts I've written, largely using .


Solution

  • Currently I've managed to add "View on Wiki" and "Edit on Wiki" buttons to each page, along with a few more that are not Wiki-related - and I'm looking to add "New page" to it... but essentially my question boils down: what is the URL for New page at a specified path?

    Unlike view and edit for an existing Wiki page, when you create a new Wiki page, there is no such URL which contains something like &_a=add in the browser.

    To create a DevOps Wiki page by script, we can use the REST API or Azure CLI. Both have path and content parameters required.

    I'm afraid it's not supported to use a URL link with a path only, to create a new Wiki page.