-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Java and Rest API supports update and delete of task and process instance comments #2551
Comments
Let me work on it |
@ThorbenLindhauer do we need to change UI as well or just the API? |
@ThorbenLindhauer @yanavasileva I am thinking about these APIs: DELETE - comment by ID, task ID or ProcessId What do you guys think? |
It's great to see you are onto your next contribution.
The scope of the ticket is only REST and Java API, no need for changes in the UI.
That's a good start. My tip is to have a look at delete attachment (Java/REST) API, it might be similar implementation. I see the ticket scope targets an update comment API as well. If you consider covering that in your PR as well, you will need something like I hope that helps to get you out of the door. Best, |
Thanks for your reply Yana. Let me work on these two endpoints:
Do we need to have endpoints that deletes all comments associated to taskId/processInstanceId or implementing above two endpoints will work for now? Thank you again, Yana. |
Looking into further, looks like deleting comments associated by taskId/processInstanceId makes sense. Let me implement those as well. |
@yanavasileva story says it needs to do this: All Comment APIs are covered by authorization checks Can you point me out an example where it does it checks authorization checks? |
Here:
You might notice that authorization checks are not performed for the existing comment (and attachment) APIs. I think we should still add them for newly introduced APIs. Also I don't think we need to introduce a new resources (similar to what's suggested here: #2090 (comment)) |
|
We don't need to introduce a new resource. My bad for the wording. |
@yanavasileva opened a PR. Can you please take a look at it when you get a chance? |
@yanavasileva Do you mind taking a look at this change? |
Requested changes from the contributor last week. |
processInstance DELETE /task/{taskId}/comment/{commentId} - deletes a comment of a given taskId and commentId DELETE /task/{taskId}/comment - deletes all comments of a given taskId PUT /task/comment - updates a comment DELETE /process-instance/{processInstanceId}/comment/{commentId} - deletes a comment of a given processInstanceId and commentId DELETE /process-instance/{processInstanceId}/comment. - deletes all comments of a given processInstanceId PUT /process-instance/comment - updates a comment related to: #2551 feat(engine-rest-core) Add update and delete Java/Rest APIs of task and processInstance feat(engine-rest-openapi) Add update and delete Java/Rest APIs of task and processInstance feat(engine) - add revision to comments - change authorization to task_assign from task_update - refactor code - add more java docs feat(engine) update task_assign authorization to task_work for delete/update comments Feedback Adjustments - fix verbiage in ftl files - add standalone tests for delete comment(s) by process instance id and task id - fix/rewrite sql statement - write additional process instance tests - few minor changes Fix engine-rest tests
Dev2QA handoverPrerequisite
ScenariosWe should test manually the following scenarios:
Stepswith the following steps:
EnvServer - free of choice Docs:
|
Create follow up ticket for testing multi-tenancy, migration test, concurrent test, and user operation test. => #4826 |
DELETE /task/{taskId}/comment/{commentId} - deletes a comment of a given taskId and commentId DELETE /task/{taskId}/comment - deletes all comments of a given taskId PUT /task/comment - updates a comment DELETE /process-instance/{processInstanceId}/comment/{commentId} - deletes a comment of a given processInstanceId and commentId DELETE /process-instance/{processInstanceId}/comment. - deletes all comments of a given processInstanceId PUT /process-instance/comment - updates a comment related to: #2551 --------- Co-authored-by: Prajwol Bhandari <[email protected]> Co-authored-by: <[email protected]>
@gbetances089, dev to qa note is two comments above. |
DELETE /task/{taskId}/comment/{commentId} - deletes a comment of a given taskId and commentId DELETE /task/{taskId}/comment - deletes all comments of a given taskId PUT /task/comment - updates a comment DELETE /process-instance/{processInstanceId}/comment/{commentId} - deletes a comment of a given processInstanceId and commentId DELETE /process-instance/{processInstanceId}/comment. - deletes all comments of a given processInstanceId PUT /process-instance/comment - updates a comment related to: camunda/camunda-bpm-platform/issues/2551 --------- Co-authored-by: Prajwol Bhandari <[email protected]> Co-authored-by: <[email protected]> Backported commit 536442d842 from the camunda-bpm-platform repository. Original author: yanavasileva <[email protected]>
@yanavasileva I was having a look at this, but was not able to see the comment/entry on the cockpit log. The steps I did were:
Also I was using the last 7.23 snapshot Is there's something that I'm missing? |
@gbetances089, you need those two to enable the authorization and authentication camunda.bpm:
authorization.enabled: true
run:
auth.enabled: true Then update or remove a comment. |
@yanavasileva Im was able to see the entries on the logs have question tho:
also something is not loading to me on the API docs is the process instance comments part, went there manually but can't see it, looking more deeper -> found it here at the end of the page 😵 |
I agree the user experience might be better if you can distinguish them. Let's keep it like this and iterate if we receive user's feedback. Reason here is to deliver fast and make changes if they are requested. |
@yanavasileva Just one last thing, while testing the comment on the process instance.
But I don't see the body with the comment from the task in the process instance, did I miss something on my steps? Screen.Recording.2024-12-12.at.11.17.54.mov |
DELETE /task/{taskId}/comment/{commentId} - deletes a comment of a given taskId and commentId DELETE /task/{taskId}/comment - deletes all comments of a given taskId PUT /task/comment - updates a comment DELETE /process-instance/{processInstanceId}/comment/{commentId} - deletes a comment of a given processInstanceId and commentId DELETE /process-instance/{processInstanceId}/comment. - deletes all comments of a given processInstanceId PUT /process-instance/comment - updates a comment related to: camunda/camunda-bpm-platform#2551 --------- Co-authored-by: Prajwol Bhandari <[email protected]> Co-authored-by: <[email protected]> Signed-off-by: Oleg Skrypnyuk <[email protected]>
related to camunda/camunda-bpm-platform#2551 Signed-off-by: Oleg Skrypnyuk <[email protected]>
As we discussed the created comment in this use case is a task comment. To create a process instance comment can be done via REST API by specifying the piId:
|
This issue was imported from JIRA:
What is this name?
This pseudonym name was generated based on the user name in JIRA to protect the personal data of our JIRA users. You can use this identifier to search for issues by the same reporter.User story
When using ACTHICOMMENT to save user comments for tasks and process instances, I want to be able to update and delete comments.
Background
Currently, the rest API supports the creation of comments for tasks - to complete the functionality and user journey around comments, the ability to updated and delete comments via REST API is requested (also for process instances).
Acceptance criteria
Links:
Pull requests
The text was updated successfully, but these errors were encountered: