mattermost-plugin-todo
mattermost-plugin-todo copied to clipboard
Support create / link Jira issue from ToDo task
Hi, sometimes a todo task becomes more & more important and needs some more option like time tracking or a workflow. It would be great, if a Jira issue could be created from a todo task.
We could solve this on front-end. Jira expose two functions globally (attaching it to window.MMPlugins["pluginID"] ):
isConnected(userID) which tells whether the current user is connected to Jira via Jira plugin
openCreateIssueModal(message) which opens the issue modal and attach to description the text on the Todo
It could register also an event that we could subscribe to that tell us any change on the connection status.
Once that is done, on Todo side, we would check whether the functions exist. If they do not exist, we understand the plugin is not active on this instance. If the functions exist, we check whether the current user is connected, and depending on the value, show one more button in the todos (apart of accept and won't do). When that button is clicked, we will use showCreateIssueModal(message) to open the Jira modal.
Things still to decide:
- What happens with the Todo? Will it be removed? If so, how will the sender or the attached post be notified?
- Should we add a callback to the
openCreateIssueModal(message)function so we know when the issue has been correctly created or cancelled? (to decide whether or not to delete the todo)
Hi, I suggest just creating a link to the Jira issue inside the Todo task. Otherwise one might loose the context & handling will be more difficult.
JP
Another solution instead of using the window object is to use Redux for registering all the relevant information. The functions could be also registered on redux, or made as Actions.