[TASKMGMT-57] 'requestor' of his Tasks should be able to see his own tasks and their states Created: 13/Apr/22  Updated: 13/Apr/22

Status: Open
Project: Task Management
Component/s: None
Affects Version/s: 1.2.9
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: task-view, tasks
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File TaskStoreImpl.patch    
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

I discussed this improvement with slutz 
I dug into the code how hard it would be -> its easy to achieve (I add a patch).

Situation / Problem

A content editor/Eric published content, in pages app trough workflow/tasks.

When he triggers a publication, he does not get any information at all.
He has no clue if it worked, and what happens, he has on information about:

  • If the publication was triggered at all
  • the state of his publication ->is anybody working on it? 
  • no information that a publication was approved -> he will only see by coincidence, that the node is suddenly green.

Solution - General

One should always see his own requested/triggered Tasks.

The one sees the state of every task -> 'requestor' in Task

Of course he can not assign or change the task, as he is not a part of the task's group it was sent to. Only seeing it, not being able to operate on it.

Solution - In Code

I dug a bit into the code. I think the solution is pretty easy, maybe I missed some place where also needs adaptions.
But if I see it right, it all comes down to one method that would have to be adapted in:

info.magnolia.task.persistence.TasksStoreImpl.prepareQueryStatementByUserAndStatuses(String, List<Status>)
TaskStoreImpl.patch

Code change from:

StringBuilder sql = new StringBuilder(String.format("SELECT * FROM [%1$s] WHERE (actorId = '%2$s' OR actorIds = '%2$s'", TaskNode.NAME, userId)); 

To:

StringBuilder sql = new StringBuilder(String.format("SELECT * FROM [%1$s] WHERE ((actorId = '%2$s' OR actorIds = '%2$s') OR (requestor = '%2$s')", TaskNode.NAME, userId));

 

Which will change the resulting query:

From resulting query in info.magnolia.task.persistence.TasksStoreImpl.prepareQueryStatementByUserAndStatuses(String, List<Status>):

SELECT * FROM [mgnl:task] WHERE (actorId = 'eric' OR actorIds = 'eric' OR groupIds = 'travel-demo-editors') AND (status LIKE '%Created%') AND status NOT LIKE '%Archived%'

To resulting query in info.magnolia.task.persistence.TasksStoreImpl.prepareQueryStatementByUserAndStatuses(String, List<Status>):

SELECT * FROM [mgnl:task] WHERE ((actorId = 'eric' OR actorIds = 'eric' OR groupIds = 'travel-demo-editors') OR (requestor = 'eric')) AND (status LIKE '%Created%') AND status NOT LIKE '%Archived%'

Possible nice extensions

Extension 1 - Allow sending a message/notification

  • It would be the perfect use case, of using notifications between two authors:
    When seeing a task which is assigned to somebody, one could click on an Action "Write to assignee  of Task". So he could write something like "This pub request is really important, could you take care soon of it."
  • When seeing a task which is not assigned to anybody, maybe being able to write to the whole group: "This is super important, can please take somebody care of that task?"

Extension 2 - Be informed on success

When a task finishes successful, that the requestor gets automatically informed about it by the workflow/task.


Generated at Mon Feb 12 11:02:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.