Skip to content

Commit

Permalink
Check if manage id field exists on ticket
Browse files Browse the repository at this point in the history
If the custom field, containing the manage Id does not exist. Do not
consider that ticket to be interesting to us
  • Loading branch information
MKodde committed Jun 28, 2023
1 parent 8a0a565 commit 9b3ed5a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Surfnet\ServiceProviderDashboard\Infrastructure\Jira\Factory\IssueFieldFactory;
use Surfnet\ServiceProviderDashboard\Infrastructure\Jira\Factory\JiraServiceFactory;
use Webmozart\Assert\Assert;
use function array_key_exists;

class IssueRepository implements TicketServiceInterface
{
Expand Down Expand Up @@ -55,6 +56,9 @@ public function findByManageIds(array $manageIds)
);
$collection = [];
foreach ($issues->issues as $issue) {
if (!array_key_exists($this->manageIdFieldName, $issue->fields->customFields)) {
continue;
}
$manageId = $issue->fields->customFields[$this->manageIdFieldName];
if (in_array($manageId, $manageIds)) {
$collection[$manageId] = new Issue($issue->key, $this->issueType, $issue->fields->status->name);
Expand Down

0 comments on commit 9b3ed5a

Please sign in to comment.