Is there a way to ensure a label must be entered before publishing or updating a page?
I tried including a JavaScript in custom HTML:
<script type="text/javascript" src="/confluence/includes/js/label_alert.js"></script>
At the moment the script looks like this:
<script type="text/javascript">
AJS.toInit(function(){
AJS.$('#rte-button-publish').click(function(e){
alert("Please add at least one or more labels");
});
});
</script>
I have the code from this post: https://community.atlassian.com/t5/Confluence-questions/Mandatory-labels-in-Confluence/qaq-p/39597
Since it is the first time that I do something with custom html and javascript, I do not know if it is correct at all. In any case, I don't get any alerts.
I would be grateful for any help!