About notifications when certain characters are added

shibasou
Kilo Sage

HI guys.

 

I'm currently having trouble with the notification script.

I want to skip a notification when a specific wording is added to a work note.

Other conditions can be set simply.

 

I don't know how to write a script and I need help.

Thank you.

2 ACCEPTED SOLUTIONS

Harish KM
Kilo Patron
Kilo Patron

Hi @shibasou you can write a advanced script in notification like below

var answer;
var text = current.comments.getJournalEntry(1);
gs.info(text);
if (text.includes("world")) {
    gs.info("true");
    answer= false;
} else {
    gs.info("false");
    answer= true;
}
Regards
Harish

View solution in original post

shibasou
Kilo Sage
if (current.work_notes.getJournalEntry(-1).toString().match(/world/)) {
    answer = true;
} else {
    answer = false;
}
 
In the end, this worked.

View solution in original post

6 REPLIES 6

shibasou
Kilo Sage

I want to skip⇒I want to send

Harish KM
Kilo Patron
Kilo Patron

Hi @shibasou you can write a advanced script in notification like below

var answer;
var text = current.comments.getJournalEntry(1);
gs.info(text);
if (text.includes("world")) {
    gs.info("true");
    answer= false;
} else {
    gs.info("false");
    answer= true;
}
Regards
Harish

Thanks for the reply.

Is it okay to recognize that the part of "(world)" should be changed?

Hi @shibasou you can replace that word which you want to look in your comments, if the word is found then you can send or ignore the notification

Regards
Harish