Hi,
I'm trying to build a variable (that I'll later send to a slack message) with all an issue PR's data. To retrieve the data, I use a webhook that calls api1 issue/detail with stash appType:
rest/dev-status/1.0/issue/detail?issueId={{id}}&applicationType=stash&dataType=pullrequest
The call to the webhook is successful (I get 200) and returns as expected a big json with all PR's data in this variable:
{{webResponse.body.detail.pullRequests}}
I have a Story which is linked in BB to 2 open PR's. My problem begins when I try to use smart values list handling methods, to format a message that includes both PR's relevant data:
{{#webResponse.body.detail.pullRequests)} • {{author.name}}'s {{status.toLowerCase()}} <{{url}}PR with id {{id}}>{{#if(equals(status,"OPEN"))}}, which need to be reviewed by {{#reviewers}}{{name}}{{/}}{{/}}\n{{/}}
The expected result should be a text like this:
• John Doe's open PR with id #1, which needs to be reviewed by Mark Twain, Virginia Woolf
• Jane Smith's open PR with id #2, which needs to be reviewed by Ernest Hemingway
, while instead I get a text like this:
• John Doe, Jane Smith's open, open PR with id #1, #2
I would expect the '#' operator at the beginning of the webResponse variable, to make the subsequent methods iterate all entries for pullRequests array one by one, but instead they're somehow flattened.
The same problem (I bet) prevents the {{#if}} for status OPEN to be successful.
Any hints about what I'm doing wrong?
Best regards,
Federico