-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Contrib/slackv3 readchannel #29247
Contrib/slackv3 readchannel #29247
Conversation
* Test SDK Commands * Testing branch development * forking with josh * testing branch fork * Add funtion to return the raw results of client.conversations_list for output validation and testing * Add new command and arguments to yaml file. Make changes to list_conversations function for testing * Added converstation_history command & function * Add arguments to yml for the two new fucntions (list and history). Adjust code for conversation_history() to use the GET method instead of POST * Added CommandResults to return output of the conversation_history command * Fixed conversation_history CommandResults added commas to json objects * For slack-list-channels, add the arguments that are outlined in the SDK documentation (channel_types, exclude_archived, limit, and cursor). This now supports returning different kinds of channels, archived channels, and pagination with limit and cursor * Added raw-response & limit to conversation_history function * Add name_filter argument to return a specific channels details. Also include basic context data parsing * removed the 'int' type from limit * Commented out CommandResults to continue building out response structure for context * Add context outputs to yml configuration. Add CommandResults object for context, human readable, and raw output * Update outputs with demisto.results(). Proper output of humanreadable, raw response, and context for the list_channels command * conversation_history function working. Began working on mapping user IDs to usernames * Added User ID to Username Mapping for converstation_history * Began working on SlackV3_test.py. Need to added structured test data for conversation_history * Modified conversation_history context output to align with code standards * Added limit argument to conversation history command * Added conversation ID for search, and identification of threads/replies in conversation_history command - RAF * Added function conversation_replies to read threads from parent messages - RAF * Updated get-replies to include Bot Responses * Add user fetch for channel creator * Adjust parsing and output for list_channels() for more consistency and less redundancy * Updated conversation_replies & conversation_history with dict to list statement * Added all Emoji commands * Added more error handling to conversation_history and conversation_replies * added description to the reaction commands * Remove Emoji Functions and Commands * Refactored conversation_history & conversation_replies to remove repeated variables and json * Removed whitespace from the import statements and at the end of the integration * adding RL * adding unit tests * accepted incoming changes * added new test files * Accepted Changes to both SlackV3 yaml and pack_metadata.json * Added amshamah419 suggestions for conversation_history, list_channels, and conversation_replies * Added correct error messaging to recommended return_error functions * conflicts * Fixed Flake8 E999 SyntaxError * Resolved Flake8, Vulture, and Mypy Errors on SlackV3.py * added .secrets-ignore file to pack and added a false positive secret --------- Co-authored-by: RAF <[email protected]> Co-authored-by: maimorag <[email protected]> Co-authored-by: edibleShell <[email protected]> Co-authored-by: bziser <[email protected]> Co-authored-by: Mai Morag <[email protected]>
…contrib/Slackv3-readchannel
…contrib/Slackv3-readchannel
if isinstance(channels, dict): | ||
channels = [channels] | ||
context = [] # type: List | ||
if isinstance(channels, list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why wound't it be? 🤔
I mean, we just wrapped a dictionary with []
three lines up
Co-authored-by: dorschw <[email protected]>
Co-authored-by: dorschw <[email protected]>
readable_output = tableToMarkdown(f'Channel details from Channel ID - {channel_id}', context) | ||
else: | ||
error = raw_response.get('error') | ||
return_error(f'An error occurred while listing conversation replies: {error}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why sometimes return_error
and sometimes DemistoException
? We should only raise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
Co-authored-by: dorschw <[email protected]>
Co-authored-by: dorschw <[email protected]>
Co-authored-by: dorschw <[email protected]>
* Contrib/slackv3 readchannel (demisto#27985) * Test SDK Commands * Testing branch development * forking with josh * testing branch fork * Add funtion to return the raw results of client.conversations_list for output validation and testing * Add new command and arguments to yaml file. Make changes to list_conversations function for testing * Added converstation_history command & function * Add arguments to yml for the two new fucntions (list and history). Adjust code for conversation_history() to use the GET method instead of POST * Added CommandResults to return output of the conversation_history command * Fixed conversation_history CommandResults added commas to json objects * For slack-list-channels, add the arguments that are outlined in the SDK documentation (channel_types, exclude_archived, limit, and cursor). This now supports returning different kinds of channels, archived channels, and pagination with limit and cursor * Added raw-response & limit to conversation_history function * Add name_filter argument to return a specific channels details. Also include basic context data parsing * removed the 'int' type from limit * Commented out CommandResults to continue building out response structure for context * Add context outputs to yml configuration. Add CommandResults object for context, human readable, and raw output * Update outputs with demisto.results(). Proper output of humanreadable, raw response, and context for the list_channels command * conversation_history function working. Began working on mapping user IDs to usernames * Added User ID to Username Mapping for converstation_history * Began working on SlackV3_test.py. Need to added structured test data for conversation_history * Modified conversation_history context output to align with code standards * Added limit argument to conversation history command * Added conversation ID for search, and identification of threads/replies in conversation_history command - RAF * Added function conversation_replies to read threads from parent messages - RAF * Updated get-replies to include Bot Responses * Add user fetch for channel creator * Adjust parsing and output for list_channels() for more consistency and less redundancy * Updated conversation_replies & conversation_history with dict to list statement * Added all Emoji commands * Added more error handling to conversation_history and conversation_replies * added description to the reaction commands * Remove Emoji Functions and Commands * Refactored conversation_history & conversation_replies to remove repeated variables and json * Removed whitespace from the import statements and at the end of the integration * adding RL * adding unit tests * accepted incoming changes * added new test files * Accepted Changes to both SlackV3 yaml and pack_metadata.json * Added amshamah419 suggestions for conversation_history, list_channels, and conversation_replies * Added correct error messaging to recommended return_error functions * conflicts * Fixed Flake8 E999 SyntaxError * Resolved Flake8, Vulture, and Mypy Errors on SlackV3.py * added .secrets-ignore file to pack and added a false positive secret --------- Co-authored-by: RAF <[email protected]> Co-authored-by: maimorag <[email protected]> Co-authored-by: edibleShell <[email protected]> Co-authored-by: bziser <[email protected]> Co-authored-by: Mai Morag <[email protected]> * adding false secret to secrets ignore * update release note * adding the new commands to read me * ruff error * fixing unit test * fixing unit test * fixing unit tests * docker image upgrade * ifx unit tests test_list_channels * fixing unit tests * fix mypy * remove unnecessary "get" * updating yml * adding display to yml * updating unit test * after running format * Update Packs/Slack/Integrations/SlackV3/SlackV3.py Co-authored-by: dorschw <[email protected]> * Update Packs/Slack/Integrations/SlackV3/SlackV3.py Co-authored-by: dorschw <[email protected]> * Update Packs/Slack/Integrations/SlackV3/SlackV3.py Co-authored-by: dorschw <[email protected]> * Update Packs/Slack/Integrations/SlackV3/SlackV3.py Co-authored-by: dorschw <[email protected]> * Update Packs/Slack/ReleaseNotes/3_1_47.md Co-authored-by: dorschw <[email protected]> * cr notes * bump to 3.2.0 --------- Co-authored-by: Josh Sawyer <[email protected]> Co-authored-by: RAF <[email protected]> Co-authored-by: maimorag <[email protected]> Co-authored-by: edibleShell <[email protected]> Co-authored-by: bziser <[email protected]> Co-authored-by: Mai Morag <[email protected]> Co-authored-by: dorschw <[email protected]>
Original External PR
external pull request
Contributor
@PaloSawyer
Contributing to Cortex XSOAR Content
Make sure to register your contribution by filling the contribution registration form
The Pull Request will be reviewed only after the contribution registration form is filled.
Status
Description
This commit introduces three new integration commands to the SlackV3 integration. This will allow XSOAR developers to list channels, get conversations, and get threads related to conversations
Screenshots
Minimum version of Cortex XSOAR
Does it break backward compatibility?
Must have