Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Add a label to a Confluence page via PowerScripts

Patrick_Vanhoof
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2019

I want to add the first letter of the page title as label to that page, using PowerScripts for Confluence.

The script I have is file setFirstCharacterPageTitleAsLabel with code:

number pageId = id;
string newLabel = substring(pageId.title,0,1);
addLabels(pageId, newLabel);
return
"id: " + pageId,
"title: " + pageId.title,
"label: " + newLabel;

On the page I put the 'Sil script' macro as follows:

Sil script macro.png

But as you can see I immediately get an error. What am I doing wrong?

1 answer

0 votes
Hyrum Steffensen--Cprime November 30, 2019

Hello Patrick,

I copied your script exactly as you have posted and it works perfectly according to the parameters as you described. The only way I could reproduce your error was to intentionally misspell the name of the sil script, "setFirstCharacterPageTitleAsLabel.sil". Please check the spelling of the script or copy and paste the name directly from the SIL Manager. If you would like additional help, please stop by the support chat room found anywhere in the Power Scripts for Confluence documentation. 

https://confluence.cprime.io/pages/viewpage.action?pageId=32815950

You can also chat with me via my Drift chat profile:

https://drift.me/hyrumsteffensen

Regards,

Hyrum Steffensen
Product Engineer, Power Scripts

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events