Icinga / icingaweb2-module-jira

GNU General Public License v2.0
41 stars 16 forks source link

close JIRA ticket on status OK #59

Open verboEse opened 3 years ago

verboEse commented 3 years ago

Hi.

Is it possible to automatically close the created ticket when the status changes back to "OK"?

yoshi314 commented 2 years ago

i did it by hand, using a wrapper script.

first, you have to find transition id for closing the issue, and then do a POST with that transition id.

yoshi314 commented 2 years ago
curl -u icinga2:icinga2sekrit https://jira.server.com/rest/api/2/issue/${issue_key}/transitions -X POST --data '{"transition": {"id":"701"}}' -H "Content-Type: application/json"

where 701 would be transition id for close issue. That might vary on your installation.

do :

curl -s -u icinga2:icinga2sekrit https://jira.server.com/rest/api/2/issue/PROJ-12345/transitions

to find out available transitions.

Should not be too hard to figure out how to implement it in php code.

moreamazingnick commented 2 weeks ago

you can do that using jira automation rules

onchange on icingaStatus -> close

but it must be a valid transition in your workflow