As I have code reviews open in 5-6 gerrit instances it can happen too often to forget to notify people to perform reviews on them and as anyone knows, a CR that gets old also gets obsolete and the effort invested in it is mostly lost.
I am planning to write a gerrit-reminder-bot which queries all gerrit servers for reviews opened by you, checks the age and the status (no votes and no negative votes) and sends an email to each reviewer.
Now the question is if we already have something similar that can be improved or used as a starting point.
Please note that using gerrit event stream is useless in this case because we do want to send reminder notification for stalled reviews, and obviously that a stalled review does not get any notifications.
We went with an "in-house" solution -
a script that runs a Gerrit-query and parses the (JSON) results.
Basic flow
Define: How old is "old" (in terms of "last modified" time),
before you start nagging people
Get a list of all open Gerrit-changes - in our case - as a JSON:
ssh -p $gerritPort $gerritHost gerrit query --format=JSON --current-patch-set limit:$queryLimit status:open
note -
Each line of the result is a "mini-JSON" that should be parsed on its own
The summary-line has a different format - can ignore it completely
For each line
Parse the JSON to get the key/value pairs
If not "old enough" - skip it
if (Verify < +1) --> "Forgot to Fix the Build"
else-if (CodeReview < +2) --> "Forgot to Get a Good Review"
else-if (CodeReview == +2 and Verify == +1) --> "Forgot to Submit"
For each scenario we send a slightly different mail that describes the case,
with a link to the relevant Gerrit-change.
The mail is sent both to the owner and to the reviewers (in CC),
to cover cases where the owner is on vacation (or left).
Related
I've a Mautic form with Radiobuttons where the User can select which Department he want to connect with.
o General Question (1)
o Sales (2)
o Technical Support (3)
I want to send the Request to the Person in Charge. So for example:
1: info#company.org
2: sales#company.org
3: support#company.org
I've tried different approaches, but non worked.
The most dirty one was to set the values of the radio buttons as E-Mails and send the Form to the Contact. Worked in some way, but then off course saves the Radiobutton Input to the Database as customer E-Mail. So, only smart in the first place. ;)
I've also tried campaigns, but couldn't find a nice way to use Formfields in the Campaign Templates.
I cannot accept that this couldn't be possible in a easy way. This Form gonna replace a Powermail Form in TYPO3 and there it kind of works like a charm.
Any hint is very much appreciated.
Sorry that you found the documentation bad - we are actually in the process of improving and migrating our developer docs, so please take a look at the WIP docs here: https://mautic-developer.readthedocs.io/en/latest/plugins/getting_started.html which are much improved!
(will also post this on the forum thread!)
After weeks and weeks of research and workarounds I got at the Mautic Form, here is my solution to this Challenge.
I really love Mautic and its extensiveness. It’s just a great and powerful tool.
But at this point it totally misses the market. For me it just feels so wrong and like a big error by design, when you have to create fake fields to handle formfields for such a simple task.
Not talking about the problem when the user overwrite his records before the data being send.
As mentioned this is so easy to do in TYPO3 with Powermail and so I was thinking about creating a plugin, but the documentation on this is really bad.
So here is my solution, as I was looking for simple solution for me as well as the customer.
Solution is tested and worked like a charm for me. Here’s what you can do, for everyone also looking something like this:
Create 1 custom field and label it “Owner (form)” - set Type to Text
Create 2 MySQL Trigger as follows (just copy the code 1:1, should work out of the box):
DELIMITER ;;
CREATE TRIGGER set_lead_owner_from_radiobutton_on_insert BEFORE INSERT ON leads FOR EACH ROW
IF (NEW.owner_form != NULL) THEN
IF (SELECT count(id) FROM users WHERE users.id=NEW.owner_form) > 0 THEN
SET NEW.owner_id = NEW.owner_form;
ELSE
SET NEW.owner_id = NULL;
END IF;
END IF;;
DELIMITER ;
DELIMITER ;;
CREATE TRIGGER set_lead_owner_from_radiobutton_on_update BEFORE UPDATE ON leads FOR EACH ROW
IF (NEW.owner_form != NULL) THEN
IF (SELECT count(id) FROM users WHERE users.id=NEW.owner_form) > 0 THEN
SET NEW.owner_id = NEW.owner_form;
ELSE
SET NEW.owner_id = NULL;
END IF;
END IF;;
DELIMITER ;
Create a form with a Radiobutton or Selectbox and set the “Contact Field” to our custom field “Owner (Form)”
Note: Values of the Radiobuttons / Selectboxes need to be set to the User IDs of your Mautic Instance. So you have to create an user for every Select- oder Radiobutton-Option.
Select for example “Send form results” in Actions and set “Send to owner” to yes.
That’s it.
So what does it do. It’s basically all about the MySQL Triggers. Every time a new Lead is created or updated and our custom field “Owner (form)” is not null and has a valid entry (User ID), the trigger copies the value from our field to the original Owner Field of the lead. So we can then use Owner of the Lead (in my case a Department) to send him a E-Mail.
I hope this is helpfull to someone. But even more I hope that Mautic is gonna fix this in the future, as I believe this a very essential task when it come to enterprise Websites.
Cheers,
Lufi
Mautic Forum Discussion: https://forum.mautic.org/t/send-mautic-form-to-different-recipients-based-on-formfield/24363/13
I'm working on a twilio-programable-sms chatbot that needs to provide a good chunk of information to a user at the outset of the first conversation. Currently, what we've written is about 562 characters. For some of our users, this gets broken up into chunks of 160 characters that do not necessarily show up in their SMS app in the right order.
To account for this, we're trying to break our message down into 160 character or less distinct messages that each send one-after-the-other.
However, my teammates and I are currently unsure how to accomplish this. Our application is currently written to provide a twiml response for each message that is received from a user. I've been unable to find a way to create a twiml response that indicates a number of consecutive messages, and the theoretical solutions we've come up with feel hacky and flawed.
To demonstrate, currently our code looks like this. As you can see, when a new user sends in the keyword "start" we join 4 messages together in one long text response. However we'd like each message to be sent individually, one after the other, about a second or two apart.
case #body
when "start"
if !!#user
CreateMessage::SubscriptionMessage.triage_subscribable_type(!!#user)
else
[
CreateMessage::AlphaMessage.personalized_welcome(#conversation.from, true),
CreateMessage::SubscriptionMessage.introduce_bcd,
CreateMessage::SubscriptionMessage.for_example,
CreateMessage::SubscriptionMessage.intvite_to_start
].join("\n\n")
end
We'd like to avoid creating a background worker/cron job, if possible - but welcome any and all suggested solutions.
I think your question is more on how to design synchronous(webhook response) vs asynchronous responses/messages. I have not used twiml but the concepts are same.
If you don't want to use a background job, then send fir N-1 messages using API with time delay in between, and the last message as response.
If you are OK with using background jobs, then send 1st message as response and queue a job for sending the remaining messages using API.
Heh guys,I am new to service now. I am doing translation in my portal for english and french.
For custom text I have done like this
Server script:
data.welcomeMsg= gs.getMessage('Welcome to the portal');
Html:
<p>{{data.welcomeMag}}</p>
It works good. when english is selected message will be displayed in english language,when french is selected message will be displayed in french(I have used messages table for translation).
Now,I am getting the following sentence from business rule not in widget level.
res.comments =' Request is pending approval from- ' + current.approver.name;
I want to translate this text Request is pending approval from here.So I tried this,
res.comments =gs.getMessage(' Request is pending approval from- ') + current.approver.name;
But text is not getting translated in portal.
Anything wrong with my code? Guys please correct me if I am wrong.
Thanks!!
When using gs.getMessage(...), it pulls translations from UI Messages but in my testing it doesn't match translations with leading or trailing white-space.
Try tweaking your messages a bit to see if removing those resolves it if that is what your translation has.
Change your UI Message Key from this
Request is pending approval from-
To this
Request is pending approval from-
Once I made that change, both of these worked
gs.getMessage(' Request is pending approval from- ')
gs.getMessage('Request is pending approval from-')
We're using Slack and JIRA together and we want to create one webhook for every of our users. If any user A makes a change in user B's issues, user A should be notified via Slack. But if user A makes a change in user A's issues, user A should NOT get a notification in slack.
We tried the following JQL statement for the user "max":
project = "Project Name" AND assignee="max" AND NOT status changed AFTER "-2m" by "max"
Unfortunately it does not work.
If Max makes a change to his issues, he gets a notification in Slack, but if he changes the same issue again afterwards, he does not. It seems like the "status change by" is not set at the time the webhook is triggered, but only afterwards.
Is there some kind of field for the User who triggered the webhook? That is essentially what we need.
EDIT:
More info: We're using this Slack integration and combining it with the webhook:
https://marketplace.atlassian.com/plugins/eu.wisoft.slack.jira/cloud/overview
I created an additional "all Jira notifications"-configuration with this Slack-plugin and it works quite fine. Hence, the slack plugin does work fine, but my JQL filtering is the issue apparently.
Last try:
project = "Project Name"
AND assignee="max"
AND status changed AFTER -2m
AND NOT status changed by "max" AFTER -2m
Using this from a comment, I was able to get it to work inconsistently:
A new jira-issue that I put on Todo with "max" and assignee "max", that is moved by another user to "Progress" (hence status-change), does not cause the webhook to trigger. The next time, the same user changes this issue from progress to todo or back, the webhook is triggered. It feels like at the time of the webhook call, the latest information is not available. It feels like at the time of the first change, this part fails:
AND status changed AFTER -2m
How could I fix this?
I think the JQL you're looking for is this:
project = "Project Name"
AND assignee="max"
AND status changed AFTER -2m
AND NOT status changed BY "max" AFTER -2m
This is telling JIRA:
Give me everything in project-name;
That is owned by max;
Limit it to anything where the last status change was after 2 minutes ago
Further limit it so that the last status change was NOT done by max in the last 2 minutes
I currently creating an app where the users can add a posting without logging into the app or using any credentials.
Other users of the app can open the app and directly comment on the posts(the comments are an array of the post object).
I read the parse docs and I believe that this will use advance targeting. I saw PFInstallation.currentInstallation() for advanced targeting but I believe that is based on the users class and I am not using the Parse.com users class
What I would like to do is to send a push notification to the original poster when a comment is added to their post... So, I was wondering how I would go completing that?
Thanks!
It couldn't be easier,
Installation has a "user" column. Just make a query that matches the "user" of interest. So, your code will look something like this....
if ( .. comment made, need to send a push .. )
{
console.log(">>> 'comment' was added....");
var query = new Parse.Query(Parse.Installation);
query.equalTo('user', .. whoWroteThePost .. );
alert = "Wow! You have a new comment on a post you wrote!!!";
Parse.Push.send(
{
where:query,
data:{ alert: alert, badge: "Increment" }
});
return;
}
Note that you said ...
"What I would like to do is to send a push notification to the original poster when a comment is added to their post... "
In that sentence you speak of the "original poster". So, that's going to be a variable like originalPoster. So this line of code
query.equalTo('user', .. whoWroteThePost .. );
will be
query.equalTo('user', originalPoster );
Note that this is extremely common, and you can find endless examples on the web! Here's just one: example
Note that:
Parse's term "advanced targeting" is very confusing.
To phrase the same thought another way,
Parse's 'channels' are just silly, ignore them.
That is to say, simply ignore the "channels" nonsense, and just search on users. It's easier and less confusing than the channels business, which is just an extra field you have to fill-out al the time.
It's just one of those weird things about Parse.
I've never used the "non-advanced targeting" - it's stupid and pointless. And the "advanced" targeting is trivial to use: assuming you can write cloud code at all you can do "advanced" targeting. If you can write a query in cloud code, you can do "advanced" targeting.
Essentially,
query.equalTo('user', .. whoWroteThePost .. );
Note that, of course, you may have to first look up who wrote the post, and then from there you can make the query for the Push.
Note, in this process it makes:
no difference at all if the user is anonymous.
You can and should go ahead and send pushes, in the same way.
Advanced targeting is not done against users. It's just that is the easiest way to show an example.
You need to store the installation against the objects you want to push to. So in this case store the installation against the post. Then when the comment comes in you can send a notification to the installation connected to the post it relates to.
I think you are looking something called anonymous users. There is almost impossible to send notification without user's data. But, Parse.com provides something called anonymous users so that app users are not necessary to sign up in order to fully function something user related operations.
Then, you will need to store some information in order to find the target.
Parse.com Anonymous Users