Checkmk-raw jira-integration

Hi everyone, I’m looking for a way to pair Jira and checkmk. More precisely, I would like to have a ticket created in Jira at a monitoring event. Also an automatic close if a recovery message is available.

At https://forum.checkmk.com/t/check-mk-english-integration-with-jira-to-open-update-close-tickets/14204/4
a plugin by Heinlein support is suggested.

Code can be found under:


python module has been installed with:
pip install jira

Once the mkp (v0.2) is installed you have to create 2 custom fields in Jira:
monitoring-host for the hostname
monitoring-service for the service description

I created those as “Text Field (single line)” as described for the new plugin (https://checkmk.de/cms_notifications_jira.html).

Got all the IDs I need, but:

I get the following error in the notify.log:

020-03-31 13:48:44 - adding notification of cmkadmin via jira
2020-03-31 13:48:44 Executing 1 notifications:
2020-03-31 13:48:44 * notifying cmkadmin via jira, parameters: username, project, monitoring, url, priority, issuetype, password, resolution, bulk: no
2020-03-31 13:48:44 executing /omd/sites/test/local/share/check_mk/notifications/jira
2020-03-31 13:48:45 Output: Unable to create issue, JIRA response code 400, Operation value must be a string
2020-03-31 13:48:45 Plugin exited with code 2

When I remove the custom fields in Jira - issues get created without any hassle - but I need the issues to be closed as well.
Seems to be an error while passing the extra-field in create ticket.
Anybody had this issue or might have an idea how to resolve this?

Can you try and create the custom fields for hostname and service description as list fields?
It looks like we had it this way, the notification plugin uses a list type.

Thanks for your fast respone. Even from the original developer. Highly appreaciate that!

In Jira there are three list-types available.

grafik

Tried with „Select List (single choice)“ first.

Which does not make much sense, as when creating the ticket you cant really pass anything:

grafik

resulting in:

2020-10-06 09:17:50 Executing 1 notifications:

2020-10-06 09:17:50 * notifying cmkadmin via jira, parameters: username, project, monitoring, url, priority, issuetype, password, resolution, bulk: no

2020-10-06 09:17:50 executing /omd/sites/test/local/share/check_mk/notifications/jira

2020-10-06 09:17:50 Output: Unable to create issue, JIRA response code 400, Could not find valid 'id' or 'value' in the Parent Option object., Could not find valid 'id' or 'value' in the Parent Option object.

2020-10-06 09:17:50 Plugin exited with code 2

2020-10-06 09:17:51 Replaying notification 0 from backlog…

So the problem here is that you need to add options to the list-field. And this does not seem to be the way it was intended to – right? Or am I heading the wrong direction?

@r.sander push :slight_smile: