*Task fixed close issues.
This commit is contained in:
@@ -800,6 +800,7 @@ class gitlabModel extends model
|
||||
$map = $this->config->gitlab->maps->task;
|
||||
$issue = new stdclass;
|
||||
$gitlabUsers = $this->getUserAccountIdPairs($gitlabID);
|
||||
|
||||
foreach($map as $taskField => $config)
|
||||
{
|
||||
$value = '';
|
||||
@@ -812,6 +813,11 @@ class gitlabModel extends model
|
||||
}
|
||||
if($value) $issue->$field = $value;
|
||||
}
|
||||
|
||||
/* issue->state is null when creating it, we should put status_event when updating it. */
|
||||
if(isset($issue->state) and $issue->state == 'closed') $issue->state_event='close';
|
||||
if(isset($issue->state) and $issue->state == 'opened') $issue->state_event='reopen';
|
||||
|
||||
return $issue;
|
||||
}
|
||||
|
||||
@@ -848,6 +854,10 @@ class gitlabModel extends model
|
||||
if($value) $issue->$field = $value;
|
||||
}
|
||||
|
||||
/* issue->state is null when creating it, we should put status_event when updating it. */
|
||||
if(isset($issue->state) and $issue->state == 'closed') $issue->state_event='close';
|
||||
if(isset($issue->state) and $issue->state == 'opened') $issue->state_event='reopen';
|
||||
|
||||
return $issue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user