이 페이지는 Rootly가 Jira에 쓰기를 위한 구성을 자세히 설명합니다.

워크플로우 구성

Jira 이슈 생성

Create Jira Issue 액션은 Jira에 새 티켓을 생성하는 데 사용됩니다. Jira에 이슈를 생성하려면 티켓을 생성할 특정 프로젝트를 선택해야 합니다 (Project Key 필드) 그리고 Issue Type를 선택하여 티켓을 생성합니다.

이 워크플로우 액션은 incidents 또는 action items에 대한 Jira 티켓을 생성하는 데 사용할 수 있습니다. 액션 아이템에 대해서는 Create Jira Subtask를 사용하는 것이 좋습니다. 그러나 프로젝트 팀이 하위 작업을 사용하지 않는 경우 이 액션을 사용하여 Jira 이슈를 생성할 수도 있습니다.

Jira 이슈 업데이트

Update Jira Issue 액션은 Jira의 기존 티켓을 업데이트하는 데 사용됩니다. Jira의 기존 이슈를 업데이트하려면 Jira Issue to Update 필드에서 {{ incident.jira_issue_id }} 변수를 사용하여 참조해야 합니다.

이 워크플로우는 인시던트나 액션 아이템에 대해 처음에 Jira 이슈를 생성한 경우에만 작동합니다.

Jira 하위 작업 생성

Create Jira Subtask 액션은 기존 Jira 이슈 아래에 하위 작업을 생성하는 데 사용됩니다. 기존 Jira 이슈에 대한 하위 작업을 생성하려면 Parent Jira Issue 필드에서 {{ incident.jira_issue_id }} 변수. Project Key 여기에 입력된 것은 원래 Jira 이슈 생성 작업에서 사용된 것과 동일해야 합니다.

이 워크플로우 작업은 action items 또는 sub-incidents에 사용하기 위한 것입니다.

Jira 기본 필드 매핑

Labels

Jira에는 Labels라는 기본 필드가 있습니다. 이 필드를 설정하는 구문은 라벨 유형의 사용자 정의 필드를 설정하는 데 사용되는 구문과 다릅니다.

//Rootly native multi-select to Jira native Labels
"customfield_12345": {{ incident.service_slugs | join: ","}}

//Rootly custom multi-select to Jira native Labels
"customfield_10033": {{ incident.custom_fields | find: 'custom_field.slug', 'your_custom_field_slug' | get: 'selected_options' | map: 'value' | join: "," }}

//Rootly custom labels to Jira labels
//Coming soon!

Team

Jira에는 Team라는 기본 필드가 있지만, 이는 “사용자 정의 필드”로 저장됩니다. 또한 단일 팀만 선택할 수 있습니다. Jira에서 이 필드에 매핑하려면 다음 구문 형식을 사용해야 합니다:

//Format to map to Jira native Team field
{
"customfield_10001": "<jira_team_id>" 
}

//Rootly native Teams field to Jira native Team field. We used the "description field to store the corresponding jira_team_id
{
"customfield_10001": "{{ incident.raw_groups[0] | get: 'description' }}" 
}

고급 구성

위의 각 워크플로우 작업에 있는 Default 탭을 사용하면 기본 Jira 필드를 설정할 수 있습니다. Jira 프로젝트에 사용자 정의 필드가 정의되어 있거나 Jira 필드를 동적으로 설정하려면 Advanced 탭에서 사용자 정의 매핑을 통해 수행해야 합니다.

사용자 정의 필드 매핑

Jira 프로젝트에 사용자 정의 필드가 포함되어 있을 가능성이 매우 높습니다. 위의 워크플로우 작업의 기본 탭으로는 이러한 사용자 정의 필드에 매핑하기에 충분하지 않을 것입니다. Custom Fields Mapping 필드에 사용자 정의 구문을 입력해야 합니다 Advance 구성 탭에서.

Jira의 사용자 정의 필드에 매핑하려면 다음 정보를 알아야 합니다:

  • Jira의 사용자 정의 필드 ID

  • Jira의 필드 유형

  • 매핑하려는 인시던트 속성

Atlassian 문서는 Jira 사용자 정의 필드 ID를 찾는 방법을 보여줍니다.

다음은 Jira 사용자 정의 필드가 가질 수 있는 필드 유형입니다.

Rootly 인시던트 속성에 대한 Liquid 변수는 여기에서 찾을 수 있습니다.

Jira 사용자 정의 텍스트 또는 단락 필드 유형에 매핑합니다.

//Rootly native text or textarea field to Jira text
"customfield_12345": "{{ incident.functionalities }}"

//Rootly native single or multiple select field to Jira text
"customfield_12345": "{{ incident.functionalities }}"

//Rootly custom text or textarea field to Jira text
"customfield_12345": "{{incident.custom_fields | find: 'custom_field.slug', 'your-slug' | get: 'selected_options' | map: 'value' }}"

//Rootly custom single or multiple select field to Jira text
"customfield_12345": "{{incident.custom_fields | find: 'custom_field.slug', 'your-slug' | get: 'selected_options' | map: 'value' }}"

Jira의 사용자 정의 단일 선택 필드 유형에 매핑합니다.

//Rootly native single or multiple select to Jira single select
"customfield_12345": { "value": "{{ incident.raw_groups | first | get: 'name' }}" }

//Rootly custom single or multiple select to Jira single select
"customfield_12345": { "value": "{{ incident.custom_fields | find: 'custom_field.slug', 'your_custom_field_slug' | get: 'selected_options' | map: 'value' }}" }

Jira의 사용자 정의 다중 선택 필드 유형에 매핑합니다.

//Rootly native multi-select to Jira multi-select
{% assign functions = incident.functionalities %}
   {% assign array = "" %}
{% for function in functions %}
   {% assign item = '{"value":"' | append: function | append: '"}' %}
   {% assign array = array | append: item | append: "," %}
{% endfor %}
{% capture final_array %}[{{ array | remove_last: ',' }}]{% endcapture %}
"customfield_12345": {{ final_array }}

//Rootly custom multi-select to Jira multi-select
"customfield_12345": {{ incident.custom_fields | find: 'custom_field.slug', 'your_custom_field_slug' | get: 'selected_options' | to_values }}

Jira의 사용자 정의 라벨 필드 유형에 매핑합니다.

//Rootly native multi-select to Jira labels
"customfield_12345": {{ incident.service_slugs | to_json }}

//Rootly custom multi-select to Jira labels
"customfield_10033": {{ incident.custom_fields | find: 'custom_field.slug', 'your_custom_field_slug' | get: 'selected_options' | map: 'value' | to_json }}

//Rootly custom labels to Jira labels
//Coming soon!

Jira의 사용자 정의 숫자 필드 유형에 매핑합니다.

//Rootly custom number field to Jira number field
"customfield_26117": {{ incident.custom_fields | find: 'custom_field.slug', 'your_custom_field_slug' | get: 'selected_options.value' }}

Jira의 사용자 정의 날짜/시간 필드 유형에 매핑합니다.

//Rootly native datetime to Jira datetime
"customfield_10030": "{{incident.started_at | date: '%FT%T%:z' }}"

//Rootly custom datetime to Jira datetime
"customfield_26218": "{{ incident.custom_fields | find: 'custom_field.slug', 'your_custom_field_slug' | get: 'selected_options.value' | date: '%Y-%m-%dT%H:%M:%S.%d%z' }}"

Jira의 사용자 정의 사용자 필드 유형에 매핑합니다.

//Rootly user to Jira custom user field ( Single Select )
{% assign jira_email = incident.roles | find: 'incident_role.slug', 'incident-commander' | get: 'user.email' %}
"customfield_20825": { "id": "{{ team.jira_users | where: 'email', jira_email | first | get: 'account_id' }}" }
//Rootly user to Jira custom user field ( Multi Select )
{% assign jira_email = incident.roles | find: 'incident_role.slug', 'incident-commander' | get: 'user.email' %}
"customfield_20825": [{ "id": "{{ team.jira_users | where: 'email', jira_email | first | get: 'account_id' }}" }]

API 페이로드

인시던트 심각도에 따라 Jira 우선순위 필드를 동적으로 설정합니다.

{% if incident.severity_slug == 'sev0' %}
  { "priority": [ { "set": { "name" : "High" } } ] }
{% elsif incident.severity_slug == 'sev1' %}
  { "priority": [ { "set": { "name" : "Medium" } } ] }
{% elsif incident.severity_slug == 'sev2' %}
  { "priority": [ { "set": { "name" : "Low" } } ] }
{% endif %}

기존 Jira 이슈에 댓글을 추가합니다.

{
  "comment": [
    {
      "add": {
        "body": "Enter your message here. Liquid syntax is supported here."
      }
    }
  ]
}

Jira 이슈 연결 작업 항목에 대해 생성된 Jira 이슈를 인시던트에 대해 생성된 기존 이슈에 연결합니다.

//Set linkage to "Relates to"
{
  "issuelinks": [
    {
      "add": {
        "type": {
          "name": "Relates",
          "outward": "relates to"
        },
        "outwardIssue": {
          "id": "{{ incident.jira_issue_id}}"
        }
      }
    }
  ]
}

//Set linkage to "Action item for"
{
   "issuelinks": [
      {
         "add": {
            "type": {
               "name":"Action",
               "outward":"action item for"
            },
            "outwardIssue": {
               "id":"{{ incident.jira_issue_id}}"
            }
         }
      }
   ]
}

Jira의 기본 Labels 필드를 Jira에서 설정합니다. 이는 Jira의 기본 필드이므로 API 페이로드 필드를 통해 업데이트할 수 있습니다.

{
"labels": [{"set": ["label1", "label2"]}]
}

Jira에서 기본 Components 필드를 설정합니다. 이는 Jira의 기본 필드이므로 API 페이로드 필드를 통해 업데이트해야 합니다.

일반적으로 팀들은 Rootly의 Services 필드를 Jira의 Components를 나타내는 데 사용하기를 좋아합니다. 아래 예시는 이 일반적인 시나리오를 보여줍니다. Rootly의 다른 다중 선택 필드를 사용하여 Jira의 Components를 나타낼 수도 있습니다. 단, 아래 코드를 사용하는 Rootly 속성을 참조하도록 조정해야 합니다.

이것이 작동하려면 반드시 Rootly의 Service 이름이 Jira의 Components 이름과 정확히 일치하는지 확인해야 합니다.

{% assign components = incident.services %}
{
  "components": [
    {
      "set": [
      {% for component in components %}
        {
          "name": "{{ component }}"
        }{% unless forloop.last %},{% endunless %}
      {% endfor %}
      ]
    }
  ]
}

디버깅

아래는 구성 과정에서 발생할 수 있는 일반적인 오류입니다. 오류 응답을 보려면 디버그하려는 특정 워크플로우를 찾아 > 실행 보기 > 보기를 선택하세요.

오류댓글
issue_id cannot be null.오류 이유…
이는 주로 Jira 이슈 업데이트 작업에서 발생합니다. 이는 업데이트하려는 참조 Jira 이슈가 존재하지 않음을 의미합니다.

해결 방법…
Jira 이슈가 이미 생성되고 인시던트에 연결된 후에 워크플로우가 실행되도록 하세요.
"customfield_12345": "Custom Field is required."오류 이유…
이는 지정된 사용자 정의 필드가 Jira 프로젝트에서 필수 필드로 구성되어 있고 워크플로우가 이 필드에 값을 전달하지 않고 있음을 의미합니다.

해결 방법…
특정 필드에 매핑하기 위해 사용자 정의 필드 매핑을 추가하거나 Jira 프로젝트에서 해당 필드를 선택 사항으로 구성할 수 있습니다.
unexpected token at '{ "customfield_10032": }'오류 이유…
사용자 정의 매핑 구문이 잘못되었습니다.

해결 방법…
매핑 구문을 수정하세요.
Specify a valid project ID or key오류 이유…
이는 작업에서 선택한 Jira 프로젝트 키가 선택한 Jira 인스턴스에서 사용할 수 없음을 의미합니다.

해결 방법…
Jira 인스턴스를 다시 선택한 다음 프로젝트 키를 다시 선택하세요.
The issue type selected is invalid.오류 이유…
이는 작업에서 선택한 Jira 이슈 유형이 선택한 Jira 프로젝트에서 사용할 수 없음을 의미합니다.

해결 방법…
프로젝트 키를 다시 선택한 다음 이슈 유형을 다시 선택하세요.

지원

이 통합에 대해 도움이나 추가 정보가 필요하면 support@rootly.com로 문의하거나 Help > Chat with Us로 이동하여 채팅을 시작하세요.