Tracing nested references with ServiceRocket Reporting plugin

Mike Pearson June 19, 2018

I've got 3 ServiceRocket Scaffolding templates that form a hierarchy of references (using list-data fields):

  1. Customer
  2. Order (contains a list-data field, data:Customer, referencing pages made with the Customer template)
  3. Shipment (contains a list-data field, data:Order,  referencing pages made with the Orders template)

My challenge now is: given a Customer, how can I report on all the shipments associated with the customer?

I thought I could just use a supplier keychain as follows:

{local reporter:page:children|source=Shipments}

{text-filter:data:Order > data:Customer|include=MyCustomerName}

{local reporter}

But this doesn't seem to work.

Can anyone kindly advise how I might get this to work?

2 answers

1 accepted

0 votes
Answer accepted
Mike Pearson June 20, 2018

I think I've managed to get it working by nesting reporters:

{report-block}

{local-reporter:page:children|source=Orders}
{text-filter:data:Customer|include=MyCustomerName}
{local-reporter}

{report-body:injected=true}
{report-list:injected=true}
{local-reporter:page:children|source=Shipments}
{text-filter:data:Order|include=%page:title%}
{local-reporter}
{report-body}
{report-info:page:title}
{report-body}
{report-list}
{report-body}

{report-block}

 

NOTE: I'm posting here with the wiki-markup version for illustrative purposes.  In practice, I'm using the plugin UI, and have not actually tested the wiki version.  Consider the above pseudo-code to demonstrate the setup - you will have to translate into the plugin's UI or XML.

0 votes
Mike Pearson June 19, 2018

My next attempted strategy was to first create a collection of all orders that reference the customer:

{report-variable:name=CustomerOrders}
{local-reporter:page:children|source=Orders}
{text-filter:data:Customer|include=MyCustomerName}
{local-reporter}
{report-variable}

This works as a first step.  ...but now I'm not sure how I can report on all the shipments, and filter out only the ones that have data:Order included in this collection. 

Not sure if this is a workable approach. ...just thought I'd share the idea, in case anyone knows how to get it working.  ...otherwise I'm happy with any solution that works!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events