# 슬랙 통합에서 게시물을 상위 주제에 선택적으로 스레딩

**URL:** https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759
**Category:** Feature
**Tags:** chat-integration
**Created:** [5월 7, 2020, 9:33오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759 "2020-05-07T21:33:45Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [7월 6, 2020, 9:28오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/22 "2020-07-06T21:28:19Z")

</div>

예전에 스레딩(threading) 규칙을 설정해 두셨고, 최신 업데이트를 적용한 이후로는 스레딩이 더 이상 이루어지지 않는다는 말씀이신가요? 아니면 업데이트를 통해 스레딩이 시작되기를 기대했는데 실제로는 그렇게 되지 않고 있다는 말씀이신가요?

저는 discourse [093ee1d80c](https://github.com/discourse/discourse/commits/093ee1d80c269afd00ba1341a3e71eb97e4ce7f1)와 [discourse-chat-integration](https://github.com/discourse/discourse-chat-integration) da91061(현재 최신 버전)을 사용 중이며, `thread` 규칙이 설정된 채널에서는 응답이 올바르게 스레딩되고 있습니다. 단, `thread` 규칙으로 설정된 채널에 한해서 그렇습니다.

스레드 규칙 설정을 보여주시겠어요? Admin → Plugins → Chat Integrations에서 다음과 같이 표시되는 규칙을 확인하실 수 있어야 합니다.

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/9/299a8188b66d60109938317336bcebb22dd0f8cc.png)

편집 연필 아이콘을 클릭하면 다음과 같은 화면이 표시되어야 합니다.

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/3/73520cbbde7a9988d42238296947591f0c91bbac.png)

만약 규칙이 다음과 같이 표시된다면:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/6/d6220847e6b817b0371c60831c02d291cf5a5c7a.png)

해당 규칙은 스레드를 사용하지 않습니다.

위에서 이 설정이 사이트 전체가 아닌 규칙별로 적용되는 이유에 대한 설명을 보실 수 있습니다.

slack에서 `/discourse` 명령(또는 통합을 설정할 때 선택한 명령)으로 규칙을 설정할 때는 [Discourse Chat Integrations](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522/1) 에 문서화된 대로 `watch`나 `follow` 대신 `thread`를 사용해야 합니다.

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [7월 6, 2020, 9:39오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/23 "2020-07-06T21:39:49Z")

</div>

네, 슬랙 통합 설정을 확인해서 `All Posts and Replies` 인스턴스를 전부 `All posts with threaded replies`로 변경해야 합니다.

현재 대부분의 채널 통합에서 모든 게시글과 답변을 표시하고 있습니다. 앞으로는 모든 게시글과 스레드 답변만 표시하도록 변경해도 문제가 생길까요? 제가 재설정해야 할 채널이 많아 한 번에 제대로 설정하고 싶어서요. 👍

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [7월 6, 2020, 10:06오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/24 "2020-07-06T22:06:02Z")

</div>

질문을 제대로 이해했다면: 아니요, 아무것도 “나쁘게” 만들지 않습니다 — 새로운 알림을 Slack으로 보내는 것을 결코 방해하지 않도록 설계되어 있어 안전합니다. 다만, 통합 기능이 스레드를 알고 있다면 채널 대신 해당 스레드로 보내는 것뿐입니다. 어떤 이유에서든 스레드 컨텍스트를 인식하지 못하면 규칙에 설정된 대로 채널로 보내게 됩니다.

"스레드 답변이 있는 모든 게시글"은 다음을 의미합니다:

- 기존 주제에 새 게시글이 추가될 때:
  - 해당 주제에 스레드 ID가 저장되어 있다면, 이를 사용하여 스레드를 게시합니다.
  - 해당 주제에 스레드 ID가 저장되어 있지 않다면, Slack으로 알림을 게시한 후 해당 새 Slack 게시글의 스레드 ID를 주제의 추가 게시글에 사용합니다. 그 시점부터 스레딩이 시작됩니다.

- 새 주제가 Slack에 게시되면, 결과적으로 생성된 스레드 ID를 저장하여 해당 주제에 대한 추가 게시글이 Slack에 스레드 응답으로 보내지도록 합니다.

이를 "단순히 watch처럼 동작하되, 게시할 스레드를 알고 있다면 대신 해당 스레드로 게시한다"고 요약할 수 있습니다.

또한, “transcript” 기능을 사용하여 Slack 내용을 Discourse의 새 주제로 게시할 때, _어떤_ 규칙 설정과도 무관하게 _항상_ 스레드 ID를 저장하려 시도합니다. 이를 통해 `thread` 규칙이 _이미 존재하거나_ _미래에 추가되더라도_, Discourse의 새 주제에 대한 답변 게시가 적절한 Slack 스레드에 공지되도록 합니다.

기존 규칙은 `bin/rails c`로 입력하면 변경할 수 있을 것으로 생각하지만, 의도적으로 어떤 채널을 스레딩하고 어떤 채널은 하지 않기로 선택한 제 라이브 사이트에서 그렇게 하고 싶지 않습니다. 또한 Ruby를 배운 지가 너무 오래되어 포럼에서 도움을 주려 무작정 Ruby 코드를 입력했다가 여러분의 화면에서 터져버릴까 봐 걱정됩니다. :sadpanda: 아마 `DiscourseChat::Rule.where(`로 시작할 것 같지만, 그 이상은 큰 도움이 되지 못할 것 같습니다. 죄송합니다!

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [7월 6, 2020, 11:14오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/25 "2020-07-06T23:14:24Z")

</div>

@sunjam 참고로, 이 기능이 바람직하고 가치 있다고 평가해 주셔서 감사드립니다! (솔직히 저는 슬랙 스레드를 그다지 좋아하지는 않지만, 저보다 스레드를 더 유용하게 생각하는 다른 사람들을 위해 이 작업을 진행했기 때문에 더더욱 그렇습니다!)

UI에 모든 `watch` 규칙을 `thread` 규칙으로 변환하는 버튼을 추가하는 것이 합리적일 것 같습니다. 하지만 저는 실제로 이를 구현할 만큼 충분한 지식을 가지고 있지 않고, 저 자신도 이 기능을 사용하지 않을 것입니다. 저는 주로 백엔드 개발을 하다가 discourse에 살짝 손을 대고 있는 수준이라, 이런 버튼을 추가하는 PR을 리뷰하는 데에도 큰 도움이 되지 못할 것입니다. 누군가 이 기능을 구현하고 싶어 한다면, 제가 할 수 있는 것은 그저 열정적으로 응원하는 정도입니다. 🙂

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [7월 16, 2020, 2:16오전 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/26 "2020-07-16T02:16:57Z")

</div>

@mcdanlj 님, 문제를 발견했습니다. 새 채널 통합을 생성할 때, 필터 테스트 통과 2.6 beta1에서 스레드형 답변 옵션이 표시되지 않습니다. 통합이 생성된 후에는 통합을 편집하면 해당 옵션이 나타납니다.

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [7월 16, 2020, 11:24오전 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/27 "2020-07-16T11:24:09Z")

</div>

지금 저도 같은 현상을 확인했습니다. 해당 UI를 전혀 인지하지 못했고, 저는 Slack의 슬래시 명령어로 규칙을 생성했거든요.

프론트엔드 코드에 대한 제 제한적인 이해 범위 내에서, 이것은 @david가 다른 통합 유형에서 `thread`를 숨기도록 요청한 코드의 산출물(artifact)이라고 생각합니다:

```plaintext
  @computed("channel.provider")
  available_filters(provider) {
    const available = [];

    if (provider === "slack") {
      available.push({
        id: "thread",
        name: I18n.t("chat_integration.filter.thread"),
        icon: "chevron-right"
      });
    }

```

제 추측이 틀렸을 수도 있습니다.

하지만 저는 정말 백엔드 개발자라서 이것을 어떻게 수정해야 하는지 모르겠습니다. 기존 규칙을 편집할 때만 `channel.provider`가 `slack`이 되고, 새 규칙을 생성할 때는 그렇지 않은 이유가 무엇인지도 모르겠어요. 😬

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [7월 16, 2020, 11:32오전 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/28 "2020-07-16T11:32:09Z")

</div>

이렇게 하면 될 것 같습니다:

> <https://github.com/discourse/discourse-chat-integration/commit/945c0a6e4f2a844ce66be711d6342ef982541206>

제가 제안한 방법이 잘 동작하는지 알려주세요 🙂

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [7월 16, 2020, 1:34오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/29 "2020-07-16T13:34:07Z")

</div>

제가 확인해 본 결과, 문제가 해결되었습니다. 제가 알지 못했던 부분을 정리해 주셔서 감사합니다, @david!

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [7월 17, 2020, 12:42오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/30 "2020-07-17T12:42:51Z")

</div>

@sunjam 참고로, 내 슬랙 통합 규칙 중 대부분을 watch에서 thread로 옮기기로 결정한 후, 그 고충을 잘 이해하게 되었습니다. 정말 눈앞이 하얘질 정도였고, 끝낼 수 있어서 다행이었습니다. 그래서 제 작업 방식에 대해 다른 접근을 했어야 했는지는 잘 모르겠지만, 변환에 필요한 노력이 결코 적지 않다는 점은 결코 과소평가하지 않습니다. 적어도 일회성 비용이니까요.

모든 일반 watch 규칙을 thread 규칙으로 변환할 수 있는 한 줄짜리 rails 콘솔 명령어가 있다면, 아직까지 찾지 못했습니다—있었다면 그걸 사용했을 텐데, 그 후 watch 규칙으로 유지하고 싶었던 몇 가지 규칙만 다시 변환했을 겁니다. ☺

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [7월 17, 2020, 1:55오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/31 "2020-07-17T13:55:42Z")

</div>

Slack 쪽에서 **모든 안 읽음** 과 **스레드** 에 스레드 답글이 표시되고 있나요? 새 게시글은 표시되는 것을 확인했지만, 스레드 답글은 이러한 알림을 트리거하지 않는 것 같습니다.

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [7월 17, 2020, 5:18오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/32 "2020-07-17T17:18:56Z")

</div>

Discourse가 게시하는 메시지는 다른 Slack 스레드와 다르게 알림을 보내지 않습니다. 하지만 이 문제는 Discourse 자체를 벗어나 Slack의 스레드 알림 작동 방식과 관련된 것입니다. Slack의 스레드 알림 규칙이 훌륭하지 않다고 생각하지만, Slack은 무작위 사람들이 개선 사항을 기여할 수 있는 오픈 소스 프로젝트가 아닙니다. Slack 스레드에 참여하거나 구독해야 해당 스레드에 추가된 게시물의 알림을 받을 수 있습니다. 적어도 이번 주에는 그런 규칙입니다. Slack에 스레드가 처음 도입되었을 때 채널 알림 규칙을 따랐던 것 같습니다. Slack에서 스레드 알림이 채널 알림을 따르도록 설정할 수 있는 옵션을 찾을 수 없는데, 이로 인해 업무에서 중요한 정보를 놓치게 되어 정말 답답합니다.

저는 Slack의 스레드 구현 방식이 너무 마음에 들지 않아, 이 기능을 구현한 사람이 바로 저라는 사실은 정말 아이러니합니다. 하지만 저는 소수 의견이라고 생각하며, Slack의 스레드를 진정으로 좋아하는 다수 사용자들이 Discourse를 더 친근하게 느끼도록 하기 위해 이 기능을 구현했습니다.

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [7월 17, 2020, 5:27오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/33 "2020-07-17T17:27:46Z")

</div>

설명해 주셔서 감사합니다. _ThreadExample_에 참여하는 사람들이 스레드 형식의 답변을 볼 수 있을 것 같고, 그렇게 작동하는 것만으로도 충분히 좋습니다. 어쨌든, 이는 Slack 쪽에서 혼란을 줄이는 데 매우 유용한 옵션이며, 다른 채팅 통합 서비스들도 이 개념의 유사한 변형을 도입하는 데 영감을 줄 수 있기를 바랍니다!

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [7월 17, 2020, 5:34오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/34 "2020-07-17T17:34:37Z")

</div>

이것은 사실입니다. 여기서 "해당 당사자"에는 스레드에서 세 개의 세로 점 메뉴를 내리고 “스레드 팔로우”(첫 번째 옵션)를 선택하는 사람들도 포함됩니다.

방금 스레드 초반에 목업이 있었다는 걸 깨달았지만, 실제로 작동하는 예시를 공유한 적은 없었습니다. 그래서 오늘부터 [https://forum.makerforums.info/c/k40](https://forum.makerforums.info/c/k40) 의 슬랙 채널에서는 다음과 같은 모습을 볼 수 있습니다:

 ![threaded-slack-post-example](https://global.discourse-cdn.com/meta/original/3X/c/8/c87934abdb0875a3cdb704b2aec2f4a6cfc9a593.png)

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [8월 6, 2020, 5:32오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/35 "2020-08-06T17:32:59Z")

</div>

오늘 처음 해봤는데… 꽤 멋지네요.

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [8월 14, 2020, 7:31오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/36 "2020-08-14T19:31:57Z")

</div>

@david 님에게 진심으로 감사드립니다. 트랜스크립트를 게시할 때 thread\_id 설정을 무시하고 채널에 게시되던 버그를 수정해 주셨기 때문입니다!

---

<div class="post-metadata">

### Author: ![k4rtik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/k4rtik/32/119508_2.png) [@k4rtik](https://meta.discourse.org/u/k4rtik)
#### Post date: [8월 28, 2020, 10:47오전 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/37 "2020-08-28T10:47:02Z")

</div>

@mcdanlj 님 안녕하세요

슬랙에서 Discourse 스레드 동기화 기능을 활성화해 주셔서 감사합니다. 한 가지 문제를 발견했는데, 링크를 한 줄로만 붙여넣어 onebox로 게시하면 슬랙 스레드의 게시된 메시지 안에서 해당 링크가 완전히 사라지고 빈 줄만 남습니다. 제 경우엔 링크가 두 줄의 텍스트 사이에 위치해 있었는데, 이 두 줄의 텍스트는 정상적으로 게시되었습니다.

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [8월 28, 2020, 11:48오전 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/38 "2020-08-28T11:48:07Z")

</div>

내가 한 어떤 작업도 게시된 메시지의 \_내용\_을 변경하지 않았습니다. 그저 때때로 대상 스레드를 설정할 뿐입니다.

Slack에 게시된 메시지의 서식 문제를 위해 별도의 버그 보고와 별도 스레드를 제안합니다. 저는 그 부분에 대해 확인하거나 건드리지 않았습니다.

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [8월 28, 2020, 2:30오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/39 "2020-08-28T14:30:50Z")

</div>

요약: 슬랙에 스레드된 답변을 보낼 때 주제를 이동하면 문제가 발생합니다.

제가 발견한 점 중 하나는, 디스커스에서 주제를 카테고리 간으로 이동하면 슬랙 채널의 스레딩이 깨진다는 것입니다. 이는 사용자가 특정 카테고리에 주제를 생성한 후, 다른 슬랙 채널이 설정된 다른 카테고리로 주제를 이동하는 경우와 관련이 있습니다.

게시물 A가 이동되었기 때문에 더 이상 슬랙의 동일한 위치에 스레드된 답변을 보내지 않습니다. 이로 인해 슬랙 쪽에서는 답변이 전혀 표시되지 않습니다. 답변을 개별적으로(스레드 없이) 유지하면 이러한 잠재적 문제를 피할 수 있습니다.

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [8월 28, 2020, 4:31오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/40 "2020-08-28T16:31:35Z")

</div>

그 정도면 일리가 있는 것 같아. 그런 경우엔 어떤 게 맞는 행동인지 나도 잘 모르겠거든…

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [8월 28, 2020, 5:36오후 UTC](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759/41 "2020-08-28T17:36:12Z")

</div>

확실하지는 않지만, 언급할 가치가 있다고 생각합니다. 하나의 우회 방법은 스레딩 없이 특정 추가 Slack 채널에서만 통합을 사용 가능하게 하여, 적어도 한 채널에는 표시되도록 하는 것입니다. 👍

[이전 페이지](https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759.md?page=1)
