Inbound Email Actions not setting field values

Rocky5
Kilo Sage

Hello Experts,

 

I have created an inbound email action to create a standard change. But, the provided Field Actions are not populating when change request is created. I can populate assignment group from script but I am not able to populate assigned to field as sender of email from script and also field actions. 

 

I can use "current.assigned_to = email.body.assign;"  in the script but I do not want users to give assigned to value in email body. why field actions are not working? and what are the other ways to set assigned to field as 'sender'.

 

Rocky5_0-1671721422398.png

 

Thanks,

Rocky.

 

4 REPLIES 4

reshmapatil
Tera Guru

Hi @Rocky5 ,

 

Check this example:

current.description = email.body_text;
  current.short_description = email.subject.toString().substring(9);
 
  current.assignment_group.setDisplayValue("Development");
 
  if (email.body.assign != undefined)
    current.assigned_to = email.body.assign;
 
  current.insert();

 

Documentation:

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/notification/reference...

 

Regards,

Reshma

**Please mark my answer correct or helpful based on the impact**

Hi Reshma,

 

Like said, that script works but with that script, we have to provide in the email body like this "assign: xyz user" but I don't want to give assigned to name in email body. It has to auto populate with email sender's name. 

To set assigned to field these field actions are working for Normal Changes but not for Standard Changes not sure why!

 

Thanks,

Rocky.

Hi @Rocky5 ,

 

Okay.

 

1. Check if any other script is running after current.update() which is stopping from update.

2. Try once by adding current.setWorkflow(false) and try to update.

3. Can also check for  Assignment Rules.

4. Check on the same table if you have any other Inbound action. If yes, then mark the 'Stop processing' checkbox in your action and check once.

 

Regards,

Reshma

**Please mark my answer correct or helpful based on the impact**

reshmapatil
Tera Guru

Hi @Rocky5 ,

 

Try once with Flow Designer (Flow).

 

Regards,

Reshma

**Please mark my answer correct or helpful based on the impact**