Inbound Email Actions "Create Incident" Assignment group not populating

Kays
Tera Expert

Hi Everyone

 

I have the following Inbound email Actions "Create Incident" action where i am trying to assign a ticket to whichever assignment group that gets pulled from the inbound email. The script i have changes the mandatory to grey and looks like its trying to reference the assignment group reference field, however its doesn't display the assignment group in the instance, can someone please advise on the corrected code ?

 

Thank you

Sue

 

My code is below:

 

//  Note: current.opened_by is already set to the first UserID that matches the From: email address

 

current.caller_id = gs.getUserID();

current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;

current.short_description = email.subject;

 

//current.category = "inquiry";

current.incident_state = IncidentState.NEW;

//current.notify = 2;

//current.contact_type = "email";

 

if (email.body.assignment_group != undefined)

    current.assignment_group = email.body.assignment_group;

 

if (email.body.description != undefined)

   current.description = email.body_text;

 

if (email.body.contact_type != undefined)

   current.contact_type = email.body.contact_type;

 

if (email.body.category != undefined)

   current.category = email.body.category;

 

if (email.body.subcategory != undefined)

   current.subcategory = email.body.subcategory;

 

if (email.body.priority != undefined) {

   if (email.importance.toLowerCase() == "high") {

        current.impact = 1;

        current.urgency = 1;

   }

}

 

if (current.canCreate())

    current.insert();

 

15 REPLIES 15

You didn't update it correctly, it should be the following

 

  current.assignment_group.setDisplayValue(email.body.assignment_group);

 

Hey James,

Update that, but still no joy

 

 

Can you try this

 

current.setDisplayValue('assignment_group', email.body.assignment_group);

Also try debugging by adding some log, e.g.

 

gs.info('Inbound email log; Body group name is : ' + email.body.assignment_group);

 

 

Maybe the value of the group isn't being extracted correctly 

Thanks James, i did think that and did catch a space on the group being sent and thought that may be an issue. I will also try with one that does have this syntax  abc - efg

Will add the log now

 

 

James,

Nothing showing in the log. The only error i see is the following: The selected 'Recipients in fields' - 'assigned_to' does not have value