metadata-calculate on calculated value

I am trying to sum a summed value with the metadata-calculate macro and getting strange results. This is my setup:

Page 1-1
Label: level_1
Wiki: {metadata:mctest}5{metadata}
Result: 5

Page 1-2
Label: level_1
Wiki: {metadata:mctest}3{metadata}
Result: 3

Page 2-1
Label: level_2
Wiki: {metadata:mctest}{metadata-calculate:mctest|label=level_1}{metadata}
Result: 8 (=5+3)

Page 2-2
Label: level_2
Wiki: {metadata:mctest}12{metadata}
Result: 12

Page 3
Wiki: {metadata-calculate:mctest|label=level_2}
Result: 11 (I was expecting 20...)

Has anyone tried this before or can say why it isn't working?

2 answers

1 accepted

I debugged into the Metadata plugin and found that this is not possible. Internally the nested macro is not executed, so the String "{metadata-calculate:mctest|label=level_1}" is converted to a number omitting all non-number, point and minus signs. So we get -1 for this value and 11 as result.

And for any calculations you may use CelesteCS Math for Confluence. Please contact me directly on any question on this plugin.


Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

251 views 11 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you