[SILO-259] fix: slack estimate points and sort order issue (#3208)

* fix: slack estimate points and sort order issue

* fix: excluded archive and increased limit in slack channel fetch
This commit is contained in:
Henit Chobisa
2025-05-19 14:58:20 +05:30
committed by GitHub
parent edb0aa083c
commit 6eae2ab867
3 changed files with 15 additions and 9 deletions

View File

@@ -322,7 +322,12 @@ export class SlackService {
do {
// Prepare parameters for pagination
const params: any = cursor ? { cursor, types } : { types };
const params: any= {
types,
exclude_archived: true,
limit: 999,
...(cursor ? { cursor } : {})
};
// Make the API request with cursor if available
const response = await this.client.get("conversations.list", { params });

View File

@@ -1,4 +1,5 @@
import { Request, Response } from "express";
import { validate as uuidValidate } from 'uuid';
import { E_ENTITY_CONNECTION_KEYS, E_INTEGRATION_KEYS, E_SILO_ERROR_CODES } from "@plane/etl/core";
import {
E_SLACK_ENTITY_TYPE,
@@ -600,6 +601,8 @@ export default class SlackController {
payload: payload,
});
const isUUID = (id: string | null) => id && uuidValidate(id)
if (payload.event === E_PLANE_WEBHOOK_EVENT.ISSUE_COMMENT) {
integrationTaskManager.registerTask(
{
@@ -658,7 +661,7 @@ export default class SlackController {
},
Number(env.DEDUP_INTERVAL)
);
} else if (payload.activity.field && !payload.activity.field.includes("_id")) {
} else if (payload.activity.field && !payload.activity.field.includes("_id") && !isUUID(payload.activity.old_value) && !isUUID(payload.activity.new_value)) {
const [entityConnection] = await apiClient.workspaceEntityConnection.listWorkspaceEntityConnections({
workspace_id: workspace,
project_id: project,

View File

@@ -1,10 +1,10 @@
import { Store } from "@/worker/base";
import { TSlackIssueEntityData } from "@plane/etl/slack";
import { PlaneWebhookPayload } from "@plane/sdk";
import { Store } from "@/worker/base";
import { getConnectionDetailsForIssue } from "../../helpers/connection-details";
import { ActivityForSlack, PlaneActivityWithTimestamp } from "../../types/types";
import { TSlackIssueEntityData } from "@plane/etl/slack";
const ignoredFieldUpdates = ["description", "attachment"];
const ignoredFieldUpdates = ["description", "attachment", "sort_order"];
export const handleIssueWebhook = async (payload: PlaneWebhookPayload) => {
const activities = await getActivities(payload);
@@ -35,7 +35,7 @@ export const handleIssueWebhook = async (payload: PlaneWebhookPayload) => {
return;
}
const response = await slackService.sendThreadMessage(channel, messageTs, {
await slackService.sendThreadMessage(channel, messageTs, {
text: "Work Item Updated",
blocks: message,
});
@@ -55,9 +55,7 @@ export const createSlackBlocksFromActivity = (fields: ActivityForSlack[]) => {
}
fields.forEach((field) => {
const capitalize = (str: string) => {
return str.charAt(0).toUpperCase() + str.slice(1);
};
const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
const cleanField = capitalize(field.field.replace("_", " "));
if (field.isArrayField) {