From 03ad39a7a520b01d001c54cc50c840689124b6fa Mon Sep 17 00:00:00 2001 From: padmapriyanalam Date: Thu, 16 Oct 2025 14:00:57 +0100 Subject: [PATCH 1/5] Commit POFCC changes --- .github/workflows/main.yml | 8 ++++---- README.md | 2 +- app.js | 4 ++-- package-lock.json | 4 ++-- package.json | 4 ++-- src/messages.js | 4 +--- src/setupSecrets.js | 4 ++-- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 72524255..23162320 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,10 +50,10 @@ jobs: username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - run: | - docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/cot/slack-help-bot:pr-${{github.event.number}}-${{ steps.get-short-sha.outputs.shortSha }} - docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/cot/slack-help-bot:pr-${{github.event.number}}-${{ steps.get-short-sha.outputs.shortSha }} + docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/pofcc/slack-help-bot:pr-${{github.event.number}}-${{ steps.get-short-sha.outputs.shortSha }} + docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/pofcc/slack-help-bot:pr-${{github.event.number}}-${{ steps.get-short-sha.outputs.shortSha }} if: startsWith(github.ref, 'refs/pull') - run: | - docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/cot/slack-help-bot:prod-${{ steps.get-short-sha.outputs.shortSha }}-${{ steps.get-timestamp.outputs.timestamp }} - docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/cot/slack-help-bot:prod-${{ steps.get-short-sha.outputs.shortSha }}-${{ steps.get-timestamp.outputs.timestamp }} + docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/pofcc/slack-help-bot:prod-${{ steps.get-short-sha.outputs.shortSha }}-${{ steps.get-timestamp.outputs.timestamp }} + docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/pofcc/slack-help-bot:prod-${{ steps.get-short-sha.outputs.shortSha }}-${{ steps.get-timestamp.outputs.timestamp }} if: github.ref == 'refs/heads/main' diff --git a/README.md b/README.md index 79634ca9..aa58ecae 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Capability Onboarding Slack help bot +# Possessions Onboarding Slack help bot Listens for new posts in a designated Slack channel and raises a coresponding request in Jira. diff --git a/app.js b/app.js index ef040807..6376835c 100755 --- a/app.js +++ b/app.js @@ -81,7 +81,7 @@ const server = http.createServer((req, res) => { } res.end('OK'); } else if (req.url === '/health/readiness') { - res.end(`

cot-slack-help-bot

`) + res.end(`

pofcc-slack-help-bot

`) } else if (req.url === '/health/error') { // Dummy error page res.statusCode = 500; @@ -481,7 +481,7 @@ app.event('app_mention', async ({ event, context, client, say }) => { } else { await say({ - text: `Hi <@${event.user}>, if you want to escalate a request please tag \`cot-support\`, to see what else I can do reply back with \`help\``, + text: `Hi <@${event.user}>, if you want to escalate a request please tag \`pofcc-support\`, to see what else I can do reply back with \`help\``, thread_ts: event.thread_ts }); } diff --git a/package-lock.json b/package-lock.json index 0387ae63..a7a2c513 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "cot-slack-help-bot", + "name": "pofcc-slack-help-bot", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "cot-slack-help-bot", + "name": "pofcc-slack-help-bot", "version": "1.0.0", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 2fb1313b..763ce547 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "cot-slack-help-bot", + "name": "pofcc-slack-help-bot", "version": "1.0.0", "description": "", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "Capability Onboarding", + "author": "Possessions Onboarding", "license": "MIT", "dependencies": { "@hmcts/properties-volume": "^1.0.0", diff --git a/src/messages.js b/src/messages.js index 78609fb0..e0b86088 100644 --- a/src/messages.js +++ b/src/messages.js @@ -291,7 +291,7 @@ function openHelpRequestBlocks() { return { "title": { "type": "plain_text", - "text": "COT Support Request" + "text": "POFCC Support Request" }, "submit": { "type": "plain_text", @@ -326,8 +326,6 @@ function openHelpRequestBlocks() { "emoji": true }, "options": [ - option('Highest'), - option('High'), option('Medium'), option('Low'), ], diff --git a/src/setupSecrets.js b/src/setupSecrets.js index a9c9d91a..01a91c1d 100644 --- a/src/setupSecrets.js +++ b/src/setupSecrets.js @@ -13,8 +13,8 @@ const setup = () => { if (config.has('secrets.cftptl-intsvc')) { setSecret('secrets.cftptl-intsvc.jira-username', 'jira.username'); setSecret('secrets.cftptl-intsvc.jira-api-token', 'jira.api_token'); - setSecret('secrets.cftptl-intsvc.cot-slack-bot-token', 'slack.bot_token'); - setSecret('secrets.cftptl-intsvc.cot-slack-app-token', 'slack.app_token'); + setSecret('secrets.cftptl-intsvc.pofcc-slack-bot-token', 'slack.bot_token'); + setSecret('secrets.cftptl-intsvc.pofcc-slack-app-token', 'slack.app_token'); } }; From e215f78b4508f8a273b586f02566bff45102c441 Mon Sep 17 00:00:00 2001 From: padmapriyanalam Date: Thu, 16 Oct 2025 16:21:34 +0100 Subject: [PATCH 2/5] Commit POFCC changes --- src/messages.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/messages.js b/src/messages.js index e0b86088..926405f6 100644 --- a/src/messages.js +++ b/src/messages.js @@ -326,6 +326,8 @@ function openHelpRequestBlocks() { "emoji": true }, "options": [ + option('Highest'), + option('High'), option('Medium'), option('Low'), ], From 89aa469fd103d2f4acf14d9fc1b745346d36f477 Mon Sep 17 00:00:00 2001 From: padmapriyanalam Date: Fri, 17 Oct 2025 14:35:34 +0100 Subject: [PATCH 3/5] changes to update Environment to drop down. --- app.js | 6 +++--- config/default.yaml | 10 +++++----- src/messages.js | 18 +++++++++++++----- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app.js b/app.js index 6376835c..a6b84b66 100755 --- a/app.js +++ b/app.js @@ -211,7 +211,6 @@ const ws = new WorkflowStep('superbot_help_request', { const helpRequest = { user, summary: inputs.summary.value || "None", - environment: inputs.env.value || "None", team: inputs.team.value || "None", description: inputs.desc.value, analysis: inputs.alsys.value, @@ -340,7 +339,8 @@ function extractLabels(values) { const priority = `priority-${values.priority.priority.selected_option.value}` const team = `team-${values.team.team.selected_option.value}` const category = `category-${values.category.category.selected_option.value}` - return [priority, team, category]; + const environment = `environment-${values.environment.environment.selected_option.value}` + return [priority, team, category,environment]; } app.view('create_help_request', async ({ ack, body, view, client }) => { @@ -366,7 +366,7 @@ app.view('create_help_request', async ({ ack, body, view, client }) => { category: view.state.values.category.category.selected_option.text.text, priority: view.state.values.priority.priority.selected_option.text.text, references: view.state.values.references?.references?.value || "None", - environment: view.state.values.environment?.environment?.value || "None", + environment: view.state.values.environment.environment.selected_option.text.text, description: view.state.values.description.description.value, analysis: view.state.values.analysis.analysis.value, replicateSteps: view.state.values.replicateSteps.replicateSteps.value, diff --git a/config/default.yaml b/config/default.yaml index f4dbcedc..b5b29def 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -2,15 +2,15 @@ slack: # bot_token: no default # app_token: no default - report_channel: bot-test - report_channel_id: C01KHKNJUKE + report_channel: pofcc-onboarding-support + report_channel_id: C09LE7XVCMV jira: start_transition_id: 21 done_transition_id: 41 - project: SBOX - issue_type_name: Bug - issue_type_id: 10900 + project: POFCC + issue_type_name: Task + issue_type_id: 3 # username: no default # api_token: no default diff --git a/src/messages.js b/src/messages.js index 926405f6..dd5415c1 100644 --- a/src/messages.js +++ b/src/messages.js @@ -383,15 +383,22 @@ function openHelpRequestBlocks() { { "type": "input", "block_id": "environment", - "optional": true, "element": { - "type": "plain_text_input", - "action_id": "environment", - "placeholder": { + "type": "static_select", + "placeholder": { "type": "plain_text", - "text": "Environment URL", + "text": "Choose an environment", "emoji": true }, + "options": [ + option('AAT / Staging', 'staging'), + option('Preview / Dev', 'dev'), + option('Production'), + option('Perftest / Test', 'test'), + option('ITHC'), + option('N/A', 'none') + ], + "action_id": "environment" }, "label": { "type": "plain_text", @@ -399,6 +406,7 @@ function openHelpRequestBlocks() { "emoji": true } }, + { "type": "input", "block_id": "description", From 572472c386448bfd3a21bc84ddef9e477a701724 Mon Sep 17 00:00:00 2001 From: padmapriyanalam Date: Mon, 20 Oct 2025 12:11:11 +0100 Subject: [PATCH 4/5] changes to remove team and capability --- app.js | 10 +----- config/default.yaml | 4 +-- src/messages.js | 84 +-------------------------------------------- 3 files changed, 4 insertions(+), 94 deletions(-) diff --git a/app.js b/app.js index a6b84b66..2c0c8dcb 100755 --- a/app.js +++ b/app.js @@ -144,7 +144,6 @@ const ws = new WorkflowStep('superbot_help_request', { // See src/messages.js:superBotMessageBlocks(inputs) const summary = values.summary_block.summary_input; const env = values.env_block.env_input; - const team = values.team_block.team_input; const area = values.area_block.area_input; const build = values.build_block.build_input; const desc = values.desc_block.desc_input; @@ -163,10 +162,6 @@ const ws = new WorkflowStep('superbot_help_request', { value: env.value, skip_variable_replacement: false }, - team: { - value: team.value, - skip_variable_replacement: false - }, area: { value: area.value, skip_variable_replacement: false @@ -337,10 +332,8 @@ app.shortcut('launch_shortcut', async ({ shortcut, body, ack, context, client }) function extractLabels(values) { const priority = `priority-${values.priority.priority.selected_option.value}` - const team = `team-${values.team.team.selected_option.value}` - const category = `category-${values.category.category.selected_option.value}` const environment = `environment-${values.environment.environment.selected_option.value}` - return [priority, team, category,environment]; + return [priority,environment]; } app.view('create_help_request', async ({ ack, body, view, client }) => { @@ -363,7 +356,6 @@ app.view('create_help_request', async ({ ack, body, view, client }) => { const helpRequest = { user, summary: view.state.values.summary.title.value, - category: view.state.values.category.category.selected_option.text.text, priority: view.state.values.priority.priority.selected_option.text.text, references: view.state.values.references?.references?.value || "None", environment: view.state.values.environment.environment.selected_option.text.text, diff --git a/config/default.yaml b/config/default.yaml index b5b29def..e4ed5b6e 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -9,8 +9,8 @@ jira: start_transition_id: 21 done_transition_id: 41 project: POFCC - issue_type_name: Task - issue_type_id: 3 + issue_type_name: Support + issue_type_id: 18400 # username: no default # api_token: no default diff --git a/src/messages.js b/src/messages.js index dd5415c1..849d234c 100644 --- a/src/messages.js +++ b/src/messages.js @@ -339,30 +339,6 @@ function openHelpRequestBlocks() { "emoji": true } }, - { - "type": "input", - "block_id": "category", - "element": { - "type": "static_select", - "placeholder": { - "type": "plain_text", - "text": "Select a category", - "emoji": true - }, - "options": [ - option('Work Allocation', 'wa'), - option('Hearings'), - option('Case Flags', 'flags'), - option('Case Linking', 'linking'), - ], - "action_id": "category" - }, - "label": { - "type": "plain_text", - "text": "Capability", - "emoji": true - } - }, { "type": "input", "block_id": "references", @@ -466,65 +442,7 @@ function openHelpRequestBlocks() { "text": "Analysis done so far", "emoji": true } - }, - { - "type": "input", - "block_id": "team", - "element": { - "type": "static_select", - "placeholder": { - "type": "plain_text", - "text": "Select other if missing", - "emoji": true - }, - "options": [ - option('Access Management', 'am'), - option('Adoption'), - option('Architecture'), - option('Bulk scan', 'bulkscan'), - option('Bulk print', 'bulkprint'), - option('CCD'), - option('Civil Damages', 'civildamages'), - option('Civil Unspecified', 'CivilUnspec'), - option('CMC'), - option('Divorce'), - option('Domestic Abuse', "domesticabuse"), - option('No fault divorce', 'nfdivorce'), - option('Employment Tribunals', 'et'), - option('Ethos'), - option('Evidence Management', 'evidence'), - option('Expert UI', 'xui'), - option('FaCT'), - option('Fee & Pay', 'feeAndPay'), - option('Financial Remedy', 'finrem'), - option('FPLA'), - option('Family Private Law', 'FPRL'), - option('Family Public Law', 'FPL'), - option('Heritage'), - option('HMI'), - option('Management Information', 'mi'), - option('Immigration and Asylum', 'iac'), - option('IDAM'), - option('Other'), - option('Private Law','private-law'), - option('Probate'), - option('Reference Data', 'refdata'), - option('Reform Software Engineering', 'reform-software-engineering'), - option('Security Operations or Secure design', 'security'), - option('SSCS'), - option('PayBubble'), - option('PET'), - option('Work Allocation', 'workallocation'), - ], - "action_id": "team" - }, - "label": { - "type": "plain_text", - "text": "Which team are you from?", - "emoji": true - } - }, - + } ], "type": "modal", callback_id: 'create_help_request' From 4d0ae551990d731488a06da0944bf029d9842bbd Mon Sep 17 00:00:00 2001 From: padmapriyanalam Date: Tue, 21 Oct 2025 17:06:00 +0100 Subject: [PATCH 5/5] POFCC-26 change main to master --- .github/workflows/{main.yml => master.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{main.yml => master.yml} (97%) diff --git a/.github/workflows/main.yml b/.github/workflows/master.yml similarity index 97% rename from .github/workflows/main.yml rename to .github/workflows/master.yml index 23162320..a72c4812 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/master.yml @@ -56,4 +56,4 @@ jobs: - run: | docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/pofcc/slack-help-bot:prod-${{ steps.get-short-sha.outputs.shortSha }}-${{ steps.get-timestamp.outputs.timestamp }} docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/pofcc/slack-help-bot:prod-${{ steps.get-short-sha.outputs.shortSha }}-${{ steps.get-timestamp.outputs.timestamp }} - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/master'