<?php
if(empty($storyIdList)) return false;

$build = $this->getByID($buildID);
foreach($storyIdList as $i => $storyID)
{
    if(strpos(",{$build->stories},", ",{$storyID},") !== false) unset($storyIdList[$i]);
}

$this->loadModel('action');
foreach($storyIdList as $storyID) $this->action->createDevOpsEvent('story', (int)$storyID, 'build', $buildID, 'storylinked');
if(dao::isError()) return false;
