Skip to content

Commit

Permalink
Use the configured custom fields in IssueDetails.php
Browse files Browse the repository at this point in the history
Author: dleusing <103404088+dleusing@users.noreply.github.com>
  • Loading branch information
dleusing authored and raviks789 committed Jan 9, 2023
1 parent 00066a8 commit 14edb0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/Jira/Web/Table/IssueDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Icinga\Module\Jira\Web\RenderingHelper;
use ipl\Html\Html;
use ipl\Html\HtmlString;
use Icinga\Application\Config;
use ipl\Html\Table;
use ipl\I18n\Translation;
use ipl\Web\Widget\Icon;
Expand All @@ -30,11 +31,13 @@ protected function assemble()
$helper = $this->helper;
$issue = $this->issue;
$key = $issue->key;
$config = Config::module('jira');

$fields = $issue->fields;
$projectKey = $fields->project->key;
$keyField = $config->get('jira_key_fields', 'icingaKey', 'icingaKey');

$icingaKey = preg_replace('/^BEGIN(.+)END$/', '$1', $fields->icingaKey);
$icingaKey = preg_replace('/^BEGIN(.+)END$/', '$1', $fields->$keyField);
$parts = explode('!', $icingaKey);
$host = array_shift($parts);
if (empty($parts)) {
Expand Down

0 comments on commit 14edb0a

Please sign in to comment.