This part of the code should be extracted into a template: see rank.jelly for an example. Then you can refer to it from publisher/config and reporter/config