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

API call to create playbook run does not respect the option to attach to existing channel #1800

Open
bizlabs opened this issue Feb 2, 2023 · 5 comments

Comments

@bizlabs
Copy link

bizlabs commented Feb 2, 2023

Summary
Mattermost 7.7 introduces the option to link a playbook to an existing channel instead of creating a new channel. This works fine when creating a playbook run interactively from the web console but not when playbook run created from API.

Steps to reproduce in mattermost 7.7.1 enterprise
Go to Playbooks and create a playbook or select an existing one
Select "Link to an existing channel" under "Actions" and select a channel.
Create a playbook run using the following api call
POST 'http://localhost:8065/plugins/playbooks/api/v0/runs' {body}
playbook run and a new channel is created with same name and linked. The run is not linked to the requested link channel.
optionally, verify playbook is valid by creating a run interactively with the blue "run" button at top right of playbook page and verify that new run is linked to the channel requested in step 2.
Expected behavior
expected that the new playbook run will be linked to the existing channel requested in step 2 above.

Observed behavior (that appears unintentional)
no error message. Just doesn't link the playbook run to the expected channel

@shalalalaw
Copy link

I'm having the same issue

@tomcat77
Copy link

tomcat77 commented Feb 17, 2023

The same for me, after creating new run via REST API it became linked to the new channel with run's name.

@AndresJ551
Copy link

Same here, even providing the same name, two identical channels are created, and when providing a post_id it "quotes" the previous post inside the new channel, far from ideal.
Hope this gets some looks, after all this incident is open since February.

@AndresJ551
Copy link

@bizlabs @tomcat77 @shalalalaw
Ok, so I did some research on this and noticed on the code: one missing parameter from the documentation:
"channel_id" you have to provide it so it creates the playbook as a thread of the selected channel.
Again, it's not ideal but it works.

{ "name": "Daily tasks", "description": "Example for an automatic playbook run.", "owner_user_id": "", "team_id": "", "post_id": "", "channel_id": "", "playbook_id": "" }

Cheers.

@tomcat77
Copy link

tomcat77 commented Oct 2, 2023

@AndresJ551
Tried your solution, it works. Thanks a lot!

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

No branches or pull requests

4 participants