There is 1 comment.
 
 
Change Request Application / cid:jira-generated-image-avatar-7b4d2877-d89e-438e-b21e-ea0e6e0066ae CRAPP-431 Open

Provide REST endpoints for all the main Change Request features

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-eb3c9c57-ce90-48d0-8fb0-1eba4b6388ad Vincent Massol on 18/Oct/26 12:31
 

Until these endpoints exist, a change request can be created from outside the wiki by posting the editor's form to the application's own resource handler. Verified on xwiki.org on 2026-10-18 (a draft change request was created, then deleted):

  1. Log in with a cookie session: POST j_username, j_password and the login page's form_token to /bin/loginsubmit/XWiki/XWikiLogin. HTTP Basic auth does not work here: outside /rest it resolves to Guest.
  2. Read the hidden fields of the /bin/edit/<Space>/<Page>?editor=wiki form.
  3. POST them, with the new content, docReference=<wiki>:<Space>.<Page>, crTitle, crDescription and crDraft=1 for a draft, to /xwiki/changerequest/<wiki>/create. The 302's Location is the new change request.

Since this goes through CreateChangeRequestHandler, nothing is skipped: the saving checks, the copy of view rights and approvers, the ready-for-merging status and the creation events all run. That is also why writing the change request pages with the generic page REST API is not an alternative: it would bypass all of these and depend on the internal storage format.

The workaround is fragile, though: it depends on the editor form's fields and on scraping HTML, and it needs a password-based session where a REST endpoint could take a token. So this issue is still needed.

PS: This post was co-written with Claude Code.