diff --git a/.github/workflows/main.yml b/.github/workflows/master.yml similarity index 72% rename from .github/workflows/main.yml rename to .github/workflows/master.yml index 72524255..a72c4812 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/master.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 }} - if: github.ref == 'refs/heads/main' + 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/master' 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..2c0c8dcb 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; @@ -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 @@ -211,7 +206,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, @@ -338,9 +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}` - return [priority, team, category]; + const environment = `environment-${values.environment.environment.selected_option.value}` + return [priority,environment]; } app.view('create_help_request', async ({ ack, body, view, client }) => { @@ -363,10 +356,9 @@ 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?.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, @@ -481,7 +473,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/config/default.yaml b/config/default.yaml index f4dbcedc..e4ed5b6e 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: Support + issue_type_id: 18400 # username: no default # api_token: no default 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..849d234c 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", @@ -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", @@ -383,15 +359,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 +382,7 @@ function openHelpRequestBlocks() { "emoji": true } }, + { "type": "input", "block_id": "description", @@ -458,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' 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'); } };