Inbound email action with guest user

harshvardhan_11
Giga Expert

Hi

I have a requirement where I have a table having ACL where user with no role can't write on any field in the table. I have "update inbound email action" on the table which will add comments on record from reply email.

Issue here is I want that outside user (which are not in service now) can also update the record. Since this uses guest user for update of record and guest user do not satisfy the ACL requirement, so the inbound action fails.

Is there any way of achieving this without giving any role to guest. Maybe using other users to update the record instead of guest, but only for this table. For other table guest user should only be used.

1 ACCEPTED SOLUTION

Brian Dailey1
Kilo Sage

Hi Harshvardhan,



There are a couple of ways you could approach it...



You can create an ACL allowing the Guest account to write to this table even without a role.


  1. Select "Advanced" on the ACL so you can use a script
  2. In the script field, enter:
              answer = !gs.isInterActive() && gs.getUserID() == (enter the sys_id of your Guest user);

Or, you could impersonate a user with an appropriate role in your Inbound Email Action by using the following:


       
        gs.getSession().impersonate(sys_id of roled user);




Either one of those should work for your scenario.





Thanks,


-Brian


View solution in original post

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Harshvardhan,



Administrators can prevent users from untrusted domains from triggering inbound actions. For example, you can prevent email from users outside your company domain from creating incidents.


Please check section 13 for more info.


http://wiki.servicenow.com/?title=Inbound_Email_Actions#gsc.tab=0



Hi Pradeep,



I actually want the users(third party users) to trigger inbound action and update the record. I read in the wiki that


"If the sender does not match an existing user, the instance impersonates the Guest user to complete any inbound email actions."



Its working fine, impersonating the guest user, but since guest user do not have access so it ignores inbound action, and doesn't update the record.



I want the way to achieve this without giving any access to guest user.




I saw some business rule through which we can use other user to update sys_email record, but they kind of work globally, I want to do it only for this table. For other table guest user can only be used to update records


Brian Dailey1
Kilo Sage

Hi Harshvardhan,



There are a couple of ways you could approach it...



You can create an ACL allowing the Guest account to write to this table even without a role.


  1. Select "Advanced" on the ACL so you can use a script
  2. In the script field, enter:
              answer = !gs.isInterActive() && gs.getUserID() == (enter the sys_id of your Guest user);

Or, you could impersonate a user with an appropriate role in your Inbound Email Action by using the following:


       
        gs.getSession().impersonate(sys_id of roled user);




Either one of those should work for your scenario.





Thanks,


-Brian


Thanks Brian,



This helped a lot.