Hi all!
I have an interesting problem trying to get the Advanced Branching working for my automation. I cannot seems to get the list to iterate in a For Each in the advanced branch.
sorry this is big.. I hope it is well enough formatted to make sense!
Thanks for any assistance :D
- Capture confluence pages linked to the Issue
- gather the version and title of each page
- Comment on each of the pages
This automation works 100% for issues with only "1" linked confluence page
- Pages are gathered via REST .../rest/api/3/issue/{{issue.key}}/remotelink
- page id's gathered via variable
{{confluencePageIds}} set from {{webResponse.body.globalId.substringAfterLast("=")}}
- log action. shows example. 322437121, 322568215, 322797582, 322830349, 328171578
- For each: Smart value, {{singlePage}} result one single iteration
- log action inside the For each: example.
single page -> 322437121, 322568215, 322797582, 322830349, 328171578
this wont work as the next REST calls for getting the page title incorrectly as:
.atlassian.net/wiki/rest/api/content/322437121, 322568215, 322797582, 322830349, 328171578?expand=version
- log action inside the For each: example.
single page -> 322437121
....atlassian.net/wiki/rest/api/content/322437121?expand=version
single page -> 322568215
....atlassian.net/wiki/rest/api/content/322568215?expand=version
single page -> 322797582
....atlassian.net/wiki/rest/api/content/322797582?expand=version
single page -> 322830349
....atlassian.net/wiki/rest/api/content/322830349?expand=version
single page -> 328171578
....atlassian.net/wiki/rest/api/content/32811578?expand=version
Then I can continue to grab version and other things I need, to complete before the final POST to comment on each of the pages.
- Create a second variable through splitting the first
{{confluenceList}} set from {{confluencePageIds.split(",")}}
compare the log result, and get exactly the same list
split list 322437121, 322568215, 322797582, 322830349, 328171578 vs 322437121, 322568215, 322797582, 322830349, 328171578
- Check size of List
Log action {{confluenceList.size}} and {{confluencePageIds.size}} both result in empty/null
- Capturing the data from {{webResponse.body.globalId.substringAfterLast("=")}} is a String not a list?
- splitting the above does not create a New List with {{confluencePageIds.split(",")}}
The Answer !!
Thanks to @Marcelo Beloni for helping out on this one.
The For Each: smart value needed to be split there and not before, trim() was also required to stop errors
The final solution in this case it needed to be {{confluencePageIds.split(",").trim()}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.