Do Project Member Webhooks not work?

lock
push_pin
done
Besvart
1

Hi,

I am trying to create a webhook via a CRMScript based on changes made to project members.

It looks like it should be possible, https://docs.superoffice.com/en/automation/webhook/reference/project-member-events.html, but nothing fires when I add/edit or delete a project member.

Here is the code registering the webhook.

#setLanguageLevel 4;

String targetCrmScript = "ProjectMemberWebHook";
String[] events = String("projectmember.created,projectmember.changed,projectmember.deleted").split(",");

NSWebhookAgent webhookAgent;
NSWebhook webhook = webhookAgent.CreateDefaultWebhook();
//NSWebhook webhook = webhookAgent.GetWebhook(1);


webhook.SetEvents(events);
webhook.SetName("Project Members Web Hook Handler");
webhook.SetType("crmscript");
webhook.SetTargetUrl(targetCrmScript);
webhook.SetErrorsEmail("trevor.sharp@synergytechnology.co.uk");
webhook.SetState(1); // Set it as active!

webhook = webhookAgent.SaveWebhook(webhook);

printLine("Webhook succeeded with ID: " + webhook.GetWebhookId().toString());

And here is the webhook.

#setLanguageLevel 4;

String variablesAvailable = "";
Map m = getVariables();
while (!m.eof())
{
    variablesAvailable = variablesAvailable + m.getKey().stripLeadingAndTrailing(" ") + " - " + m.getVal().stripLeadingAndTrailing(" ") + "<BR>";
    
    //Move To Next Record
    m.next();
}

log(variablesAvailable);

It writes ok to the log when I enable the webhook, but nothing is added to the log when I make changes to the Project Member, and I cannot get any traces from this script.

Also with the new screen for creating the webhooks via the GUI, this does not reference the Project Members table, which makes me wonder if it is not supported, but then why have a whole help page on project member events if it is not supported.

Does anyone know whether the project members web hooks should fire or not, have I missed something in my code, or am I trying to achieve the impossible.

Many thanks,

Trevor

11 t, 35 m siden | 03:01 p.m.

Alle Svar (1)

Try clearing the caches and see if the webhook is triggered then

 

NSDiagnosticsAgent da;
da.FlushCaches();

 

10 t, 59 m siden | 03:36 p.m.

Legg til svar