Discourse Assign

Summary: Allows you to assign topics and individual posts (both private and public) to a user or group.

:link: GitHub: https://github.com/discourse/discourse-assign.git
:arrow_right: Install: Follow the plugin installation guide.

Features

Discourse assign adds a “tag like” annotation on the topic list and topic header with the username of the assigned user.

It allows you to assign topics to users and list all of the assigned topics.

Also, user groups can be assigned to the topic. In that case, each group member will receive a notification. In group Interaction configuration, you can specify Who can assign this group. By default, is it set to nobody.

Screen Shot 2021-09-10 at 1.46.12 pm


Screen Shot 2021-09-10 at 1.49.32 pm

In addition to assign to specific topic, individual post can be assigned as well. This option is hidden under “…” (show more) post toolbar. When a post is assigned, information about that is included in the topic title. Also, first post contain link to assigned post.

Configuration

Site Settings

  • assigns public : out of the box all assignments are hidden from non-staff, if you want non-staff to be able to see who owns which topic, enable this setting.

  • unassign creates tracking post: out of the box when you unassign a topic a post is created in the stream to keep track of the fact it was unassigned, disable to remove the tracking post

  • assigns by staff mention if you would like mentions by a staff member of another staff member to assign a topic select this

  • assign self regex if you would like to use a magic phrase to assign stuff to yourself add a regex here

  • assign other regex if you would like to restrict it so only mentions with a particular phrase are assigned to others add something here

  • assigns user url path template to path that is used as a hyperlink for any user assigned tags.

  • unassign_on_close if a topic is closed it will automatically be silently unassigned

  • unassign_on_group_archive when a message is archived unassign it, once it moves back to inbox reassign it.

Listing assigned topics

There are 2 ways of viewing assigned topics,

  • In topic list format:

    • https://sitename.com/latest?assigned=username to view all assigned topics for a user
    • https://sitename.com/latest?assigned=* to view all assigned topics for all users
    • https://sitename.com/latest?assigned=me to view all assigned to current user
    • https://sitename.com/latest?assigned=nobody to view all unassigned
  • The user page activity there is an extra assigned tab visible to staff on activity and messages tabs

CHANGELOG

TODO

  • Keyboard shortcuts
  • Add a concept of “small whisper” so assignment info posts take up less space

Thank you to McNeel for sponsoring this work!

42 Likes

I found two issues with this plugin.

  1. On stable, the “Who can assign this group” is not showing because the plugin outlet does not exist on stable yet.

  2. Whenever an assignment to a group is being made, the webhook crashes. This is caused by a leftover line in the payload configuration here. As you can see the payload is being extended depending on whether the assignment is to a user or a group. But if the assignment is to a group, the code crashes, because the line

     assigned_to_username: assign_to.username,
    

is still present in the standard payload as well. That causes

NoMethodError (undefined method `username' for #<Group:0x0000564edeb5a5f8>
plugins/discourse-assign/lib/assigner.rb:270:in `assign'

This line should be removed.

4 Likes

Mind sending a pr through for the line removal?

2 Likes

Here is the PR, @sam

2 Likes

Argh, you beat me to it @Saif-Shines :laughing: , although I think we’ll need to remove the line before that one as well

3 Likes