Hi all,
I have a script (shown below) that traverses all pages in a space and removes labels. This works great for some cases but not all. If I create a new space, add pages and labels the script cleans them nicely. If I use on of my javadoc spaces which has 4000+ labels the script reports label removal, but the labels remain.
Example Output:
PAGE: my page
LBLS: FooBar
Labels: 'FooBar ' were removed from item: 'my page' from space: 'javadoc'
remaining LBLS: FooBar
I exported the space to xml and looked at the labels. I see nothing special about them. I am concerned by the trailing space on the labels output. I tried executing the command manually and I get the same result. I'm not sure what is blocking the removal.
Please let me know if you see an issue that I'm missing. I'm going to dig into the source code.
Thanks
Peter
#!/usr/bin/env bash function listLabels { space=$1 page=$2 ./confluence.sh -a getLabelList --space $space --title "$page"|egrep -v 'labels in list'|sed ':a;N;$!ba;s/\n/,/g;s/,$//' } function listPages { space=$1 echo Creating PageList ${space}.pages ... ./confluence.sh -a getPageList --space $space |egrep -v 'pages in list' > ${space}.pages echo PageList Complete... } function removeLabelsFromPage { space=$1 page=$2 labels=`listLabels $space "$page"` echo PAGE: $page echo LBLS: $labels ./confluence.sh -a removeLabels --space $space --title "$page" --labels $labels echo remaining LBLS: `listLabels $space "$page"` echo "-----------" } function removeLabelsFromSpacePages { space=$1 pageListFile=$2 while read line do removeLabelsFromPage $space "$line" done < ${pageListFile} } ## --------------------- ## MAIN ## --------------------- space=$1 listPages $space removeLabelsFromSpacePages $space ${space}.pages
Probably you are running into an historical inconsistency in the CLI. Confluence CLI uses: Comma separated list of labels. JIRA CLI uses a blank separated list (which is better in this case). Confluence CLI should be changed to support both, but for now use a comma. Please open an issue for the change.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please open an issue and provide an example of the CLI actions run using -v parameter. The bitbucket repository is now private, you will have to use the older version source zip.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah figured out the problem. My space generator takes javadoc and builds a space xml out of it. It splits the package names into labels but doesn't track and re-use labels. So, I have 200 + "com" labels. I think this is why I ran into the problems. I fixed the generator code and I think Atlassian fixed import so duplicate labels are no longer a problem.
Thanks for the comments. I think this is self manufacturered.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.