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

append new note if exist note on ThenComment.java #76

Open
wants to merge 1 commit into
base: release
Choose a base branch
from

Conversation

Arshiya0x7
Copy link

If there is already a note, it will be append to the note.
Also, this feature has been added that if two triggers are activated on a request, the notes of both triggers are written on the request.

But before, only one trigger note was applied to each request.

check if note not empty new note append to exist note
@@ -19,8 +19,16 @@ public RuleResponse perform(EventInfo eventInfo) {
boolean hasError = true;
try {
if (eventInfo.getAnnotations() != null) {
eventInfo.getAnnotations().setNotes(text.getText(eventInfo));
hasError = false;
if (!eventInfo.getAnnotations().notes().isEmpty()) {
Copy link
Contributor

@ddwightx ddwightx Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

I am concerned about changing the default functionality. A way to alleviate that is to add a boolean field (checkbox) labeled something like Append that would control whether or not to append or overwrite.

That being said, I actually think this solution isn't needed. Today in the Text field, instead of putting Hello World, you can put {{a:comment}}Hello World instead. If there wasn't already a comment the final comment will be Hello World. However, if there is a comment already, it will be <existing commment here>Hello World. What are your thoughts on that?

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

Successfully merging this pull request may close these issues.

2 participants