Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml → .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
18 changes: 5 additions & 13 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const server = http.createServer((req, res) => {
}
res.end('OK');
} else if (req.url === '/health/readiness') {
res.end(`<h1>cot-slack-help-bot</h1>`)
res.end(`<h1>pofcc-slack-help-bot</h1>`)
} else if (req.url === '/health/error') {
// Dummy error page
res.statusCode = 500;
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 }) => {
Expand All @@ -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,
Expand Down Expand Up @@ -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
});
}
Expand Down
10 changes: 5 additions & 5 deletions config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
104 changes: 15 additions & 89 deletions src/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function openHelpRequestBlocks() {
return {
"title": {
"type": "plain_text",
"text": "COT Support Request"
"text": "POFCC Support Request"
},
"submit": {
"type": "plain_text",
Expand Down Expand Up @@ -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",
Expand All @@ -383,22 +359,30 @@ 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",
"text": "Environment",
"emoji": true
}
},

{
"type": "input",
"block_id": "description",
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions src/setupSecrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};

Expand Down
Loading