Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack: Feature - Added action to ask question using slack blocks #33

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

bdebek-splunk
Copy link

Please ensure your pull request (PR) adheres to the following guidelines:

  • Please refer to our contributing documentation for any questions on submitting a pull request, link: Contribution Guide

Pull Request Checklist

Please check if your PR fulfills the following requirements:

  • Testing of all the changes has been performed (for bug fixes / features)
  • The manual_readme_content.md has been reviewed and added / updated if needed (for bug fixes / features)
  • Use the following format for the PR description: <App Name>: <PR Type> - <PR Description>
  • Provide release notes as part of the PR submission which describe high level points about the changes for the upcoming GA release.
  • Verify all checks are passing.
  • Do NOT use the next branch of the forked repo. Create separate feature branch for raising the PR.
  • Do NOT submit updates to dependencies unless it fixes an issue.

Pull Request Type

Please check the type of change your PR introduces:

  • New App
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Documentation
  • Other (please describe):

Security Considerations (REQUIRED)

  • If you are exposing any endpoints using a REST handler,
    please document them in the manual_readme_content.md.
  • If this is a new connector or you are adding new actions
    • Please document in the manual_readme_content.md all methods (eg, OAuth) used to authenticate
      with the service that the connector is integrating with.
    • If any actions are unable to run on SOAR Cloud, please document this in the manual_readme_content.md.
  • Are you introducing any new cryptography modules? If yes, please elaborate their purpose:
  • Are you are accessing the file system? If yes, please verify that you are only accessing paths returned through
    the Vault API.
  • Are you are marking code to be ignored by Semgrep with nosemgrep?
    If yes, please provide justification in an additional comment next to the ignored code.

Release Notes (REQUIRED)

  • Added action to send slack questions using blocks

What is the current behavior? (OPTIONAL)

  • At the moment only simple message questions are possible, blocks can be used for plain, non-interactive messages.

What is the new behavior? (OPTIONAL)

  • Now user is able to send interactive question message using custom blocks (example below + screenshot in screenshot section).
    [
    {
    "type": "context",
    "elements": [
    {
    "type": "plain_text",
    "text": "Which do you choose?",
    "emoji": true
    }
    ]
    },
    {
    "type": "actions",
    "elements": [
    {
    "type": "button",
    "text": {
    "type": "plain_text",
    "text": "Option 1",
    "emoji": true
    },
    "value": "option1",
    "action_id": "option1"
    },
    {
    "type": "button",
    "text": {
    "type": "plain_text",
    "text": "Option 2",
    "emoji": true
    },
    "value": "option2",
    "action_id": "option2"
    },
    {
    "type": "button",
    "text": {
    "type": "plain_text",
    "text": "Option 3",
    "emoji": true
    },
    "value": "option3",
    "action_id": "option3"
    }
    ]
    }
    ]

Other information (OPTIONAL)

  • Any other information that is important to this PR such as screenshots of how the component looks before and after the change.

Pay close attention to (OPTIONAL)

  • Any specific code change or test case points which must be addressed/reviewed at the time of GA release.

Screenshots (if relevant)

Screenshot

Thanks for contributing!

@@ -4596,6 +4596,507 @@
},
"versions": "EQ(*)"
},
{
"action": "ask question with block",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we have precedent with the send message action to optionally take a message string or a blocks JSON. Why not apply the same logic to the existing ask question action instead of implementing a whole new action here?

It seems to me the additional parameters in this action could prove useful in the ask question action as well, and if it mostly shared an implementation with ask question channel, could be used to enhance both actions with block capabilities at once

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phantom-jacob
Yeah I was also considering this option, as it was initially for quick customer engagement I went with easier for me to implement option at the time, but we definitely could add this capability to the existing action.

"order": 2
},
"timeout": {
"description": "Number of seconds after wich question times out. Default: 1800s (30min)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "Number of seconds after wich question times out. Default: 1800s (30min)",
"description": "Number of seconds after which question times out. Default: 1800s (30min)",

"order": 4
},
"answer_feedback": {
"description": "Custom message to send when users answers the question",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "Custom message to send when users answers the question",
"description": "Custom message to send when a user answers the question",

"order": 5
},
"show_user_answer": {
"description": "Option to show or not user's answer in feedback message",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "Option to show or not user's answer in feedback message",
"description": "Whether or not to show user's answer in feedback message",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants