-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
5.8.4, 5.9.1, 5.8.14, 5.9.2, 5.9.3
-
12
-
Severity 3 - Minor
-
4
-
Summary
The following URI used to work to create a blog post with specified label name does not work anymore in newest Confluence version (5.8.x)
/pages/createblogpost.action?spaceKey=<SpaceName>&labelsString=<LabelName>
Steps to Reproduce
- Create a blog post by pasting the following URI:
/pages/createblogpost.action?spaceKey=TEST&labelsString=test1,test2
- The above URI should create a new blog post in a space with the space key TEST with the following labels : (test1,test2)
Expected Results
the blog post page is created with the correct labels (test1,test2) saved
Actual Results
Blog is created, and the label count is correctly specified. However, the labels are not saved.
Workaround 1
Note: this workaround only works when Collaborative Editing is disabled.
- Click cog icon > General Configuration > Custom HTML
- Click the Edit button
- Paste the following into the At end of the Body field:
<script type="text/javascript"> AJS.toInit(function ($) { //is it a create page action which is called?? if( window.location.href.indexOf("createpage.action") > -1 || window.location.href.indexOf("createblogpost.action")) { //if yes is there a label given as request parameter??? var label = getUrlVars()["labels-string"]; if(label) { //simply click the labeleditbutton jQuery("#rte-button-labels").trigger("click"); //insert the label parameter value jQuery("#labels-string").val(label); //and close the label editor jQuery("#add-labels-editor-button").trigger("click"); jQuery(".dialog-button-panel a.button-panel-cancel-link").trigger("click"); } } }); //this function is needed to get the parameters from the url function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } </script><br><br>
- Click Save
- Clear your browser cache
You should now be able to create a new blog post and add labels using the following:
pages/createblogpost.action?spaceKey=<spaceKey>&labels-string=label1,label2
Note: the parameter is labels-string vs labelsString
Workaround 2
If you need a workaround that complies with Collaborative Editing, bitvoodoo did push out a third party fix that is available on the Marketplace: Label Fixer. This allows you to use the normal labelsString parameter to declare the labels in comma separated values.
WARNING: Per our Support Offerings, HTML customizations are not supported by the Atlassian support team, but we will always do their best to assist. As with all customizations, we strongly recommended testing in a development environment, prior to implementing in production. Any customizations may need to be reapplied after upgrading.
Notes
- Some customers use this parameter in order to avoid selecting different label name mistakenly.
- This method was available previously in 5.0.3
- Stopped working in the latest version, 5.8.x and 5.9.1
- is duplicated by
-
CONFSERVER-40955 URL param '&labelsString=' for actions is not working
- Closed
- is related to
-
AMKT-15538 Loading...