-
Problem report
-
Resolution: Fixed
-
Major
-
5.0.2rc1, 5.2.0alpha1, 5.2 (plan)
-
Sprint 64 (May 2020), Sprint 65 (Jun 2020), Sprint 66 (Jul 2020), Sprint 67 (Aug 2020), Sprint 68 (Sep 2020), Sprint 69 (Oct 2020), Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021), Sprint 73 (Feb 2021), Sprint 74 (Mar 2021)
-
0.125
The retrieval of the redmine project should either be working with the id or project name as specified in the placeholder and documentation.
Documentation: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/redmine
Template https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/redmine/media_redmine.xml
The code does only compare the name and gets the id if matching. IMO it should first try to match the id and match the name only if it does not match the id.
getProjectID: function(name) { var result = Redmine.request('get', 'projects.json'), project_id; if (result.response) { var projects = result.response.projects || []; for (var i in projects) { if (projects[i].name === name) { project_id = projects[i].id; break; } } } else { Zabbix.Log(4, '[ Redmine Webhook ] Failed to retrieve project data.'); } if (typeof project_id === 'undefined') { throw 'Cannot find project with name: ' + name; } return project_id; },