@ Override public DataResponse < List < Feature > > getRelevantStories ( ObjectId componentId , String teamId , String projectId , Optional < String > agileType ) { Component component = componentRepository . findOne ( componentId ) ; if ( ( component == null ) || CollectionUtils . isEmpty ( component . getCollectorItems ( ) ) || CollectionUtils . isEmpty ( component . getCollectorItems ( ) . get ( CollectorType . AgileTool ) ) || ( component . getCollectorItems ( ) . get ( CollectorType . AgileTool ) . get ( 0 ) == null ) ) { return getEmptyLegacyDataResponse ( ) ; } CollectorItem item = component . getCollectorItems ( ) . get ( CollectorType . AgileTool ) . get ( 0 ) ; QScopeOwner team = new QScopeOwner ( "team" ) ; BooleanBuilder builder = new BooleanBuilder ( ) ; builder . and ( team . collectorItemId . eq ( item . getId ( ) ) ) ; // Get teamId first from available collector item, based on component List < Feature > relevantStories = getFeaturesForCurrentSprints ( teamId , projectId , item . getCollectorId ( ) , agileType . isPresent ( ) ? agileType . get ( ) : null , false ) ; Collector collector = collectorRepository . findOne ( item . getCollectorId ( ) ) ; return new DataResponse <> ( relevantStories , collector . getLastExecuted ( ) ) ; }
Retrieves all stories for a given team and their current sprint