function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VinnieBVinnieB 

Setting AutoAssign when creating cases - help please?

There's an old thread that mentions one should modify the wsdl as below to allow the insert or update to do auto assign of objects.  I see some parts of my wsdl that are similar to this but nothing that matches it exactly.

Is there an easier way to do this?  All I want to do is apply an Auto Assign rule when creating a case.  I'm happy to have it generic so that every case created will be subjected to this rule.

THANKS!!

  <message name="insert">
    <part name="type" type="s:string" />
    <part name="record" type="s0:map" />
    <part name="autoAssign" type="s:boolean" />
    <part name="assignmentRuleId" type="s:string" />
  </message>
  <message name="update">
    <part name="type" type="s:string" />
    <part name="record" type="s0:map" />
    <part name="autoAssign" type="s:boolean" />
    <part name="assignmentRuleId" type="s:string" />
  </message>

VinnieBVinnieB
Oh.  I'm using the latest API and using Java on Tomcat.
DevAngelDevAngel

Hi Vinnie,

The new API supports this without WSDL modification. What you need to do is set the SaveOptions header.  This header has the autoAssign boolean property and the assignmentRuleId property.  You need to create a new SaveOptions header and set the properties and then add it to the message like you do the SessionHeader.

Cheers

VinnieBVinnieB

That's it!!  If anyone wants the Java code here it is.

_SaveOptions so = new _SaveOptions();

ID ruleID = new ID();

ruleID.setValue("<my rule ID>");

so.setAssignmentRuleId(ruleID);

so.setAutoAssign(true);

myBinding.setHeader("SoapService", "SaveOptions", so);

VinnieBVinnieB

OK.  That worked.  Now the case gets assigned and the email gets sent.  I'm now having a problem getting the notification email to go out.  I couldn't see anything in the saveOptions or related classes that would allow me to do this.

There are two check boxes on the New Case form in the standard GUI (below).  You've shown me how to 'check' the top one when creating a case via the API.  Is there a way to 'check' the bottom one as well?  THANKS!!

Assign case using Assignment Rules
Send notification email to contact

VinnieBVinnieB

I haven't seen a reply on this.  Did it not stand out that there was another question here? 

THANKS!!

DevAngelDevAngel

Hi VinnieB,

Sorry for the delay.  Your second question is not triggerable through the API.  You can however, get the contact email through the api and send a notification.