* Fix parse bug and story object from webhook issue function.

This commit is contained in:
Guan Xiying
2021-07-06 10:18:28 +08:00
parent ec86c142ef
commit 7db7bd4635
+9 -5
View File
@@ -712,20 +712,24 @@ class gitlabModel extends model
*
* @param array $labels
* @access public
* @return object|false
* @return object
*/
public function webhookParseObject($labels)
{
$object = null;
$object = null;
$objectType = '';
foreach($labels as $label)
{
if(preg_match($this->config->gitlab->labelPattern->task, $label->title))
if(preg_match($this->config->gitlab->labelPattern->story, $label->title)) $objectType = 'story';
if(preg_match($this->config->gitlab->labelPattern->task, $label->title)) $objectType = 'task';
if(preg_match($this->config->gitlab->labelPattern->bug, $label->title)) $objectType = 'bug';
if($objectType)
{
list($prefix, $id) = explode('/', $label->title);
$object = new stdclass;
$object->type = 'task';
$object->id = $id;
$object->type = $objectType;
}
}