I have a script block on a LiveReport page that is cycling through a list of WorkItems and looking for all the linked WorkItems that have a role of "dulplicates".
In the API documentation the WorkItem function 'getLinkedWorkItems' returns and array of LinkedWorkItems, which I can cycle through and get the role. However, the function seems to return an array of WorkItems, rather than LinkedWorkItems. I am unable to get the role of the LinkedWorkItem. When I return 'getId' from the linked work item I get the ID of the WorkItem, indicating that this is an array of WorkItems, rather than LinkedWorkItems.
In the following code I have extracted all the WorkItems ($wis) from a module:
Code: Select all
#foreach ($wi in $!wis)
#set ($linkedwis = $!wi.getLinkedWorkItems)
#foreach ($link in $!linkedwis)
#if ($!link.getRole.getId == "duplicates")
#set ($covered = $!covered + 1)
Am I doing something wrong with this code, or is it a defect?