-
Notifications
You must be signed in to change notification settings - Fork 5
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
ServiceNow Slash Commands which launch dialogs do not run inside Playbooks #167
Comments
@asatkinson This is because the first command is implemented as webapp plugin. The playbooks plugin only runs server-side commands, so this ends up being a no-op for webapp plugin commands. The alternative would be to use interactive dialogs. App framework commands are currently unsupported with Playbooks, but would be supported if webapp plugin ones were also supported. The App framework command parsing happens client-side atm, which is essentially the same issue with the webapp plugins. |
That is a good summary @mickmister. The team has been looking at some options. This is one we are investigating: Option A:
Here are others but require changes outside our plugin so not ideal: Option B. Code changes in Mattermost server - Store the trigger id received in the command arguments without encrypting it so we can match that id at the client side by dispatching a WebSocket event. Option C. Code changes in the playbook plugin - Update the code of the playbook plugin such that it somehow calls the slashCommandWillBePostedHook before the call of the API. |
@mkdbns I'm not sure if Option A is possible. There is no way for the ServiceNow webapp plugin to hook into the action of clicking that "Run slash command" button in the Playbooks UI. It's sort of a "fire and forget" action. Using a websocket message as a workaround makes sense to me, though I'm not sure how you would have that work exclusively with the user's current Mattermost tab, since I don't think we will have the chance to generate or store these ids you mention. I'm not sure if Option B would work either, for the same reason. I could be missing something about the flow of the feature though. I think Option C is the only way to go. There are likely good reasons why the Playbooks feature works the way it currently works today, so changing it to support webapp plugin commands may not be as trivial as it sounds. I would reach out to them in the Playbooks channel for a deeper discussion on this. |
@mickmister there is already a discussion in the CE Brightscout channel on this with the playbooks team. |
@mickmister @mkdbns @asatkinson we have shifted the logic to launch modals as it was before to resolve this issue in the PR Brightscout#44 for now. Here is another approach we were thinking to implement. This will resolve the issue of modals opening on multiple clients while running the slash command through ServiceNow, but will open the modal on multiple clients while running the slash command inside the playbook. Approach:
In case when playbook plugin executes a slash command:
The flow diagram for the above approach: Please let me know your thoughts on this. |
@ayusht2810 To make the diagram simpler for the So it seems the conclusion of the |
@mickmister Yes, the above approach makes sense. But we still prefer to keep the slash command logic on the server side. By moving the logic to the webapp side, it will increase the code length and complexity as we need to make some extra API calls to check if the user is connected or not to ServiceNow and is authorized to configure subscriptions to avoid opening of modal and to show certain errors.
|
If I run the slash command /servicenow create incident in the channel the slash command works fine and shows the dialog.
However if I run the same slash command inside a playbook the dialog does not open.
Dialogs used to open, but doesn't anymore.
The playbooks team says the slash commands with dialogs they have tried work correctly.
I'm wondering if the change in how dialogs get launched might be causing an issue.
I am running ServiceNow plugin 3.2.0, Mattermost 7.7.1
Here is a screenshot of two commands embedded in a playbook. The first one should launch a dialog - but does not
The second one only sends content to the channel and works fine.
The text was updated successfully, but these errors were encountered: