The CreatorCon Call for Content is officially open! Get started here.

sys_created_by (USER ID) to Name in script

tbalestreri3
Mega Contributor

Hi All,

The sys_created_by field when creating an incident returns the USERS ID which for us is employee number. How could I convert this to their name?

s.setParameter('sys_created_by', current.sys_created_by);

5 REPLIES 5

Ok..I think I understand what you are doing here. GetDisplayValue will not work in your situation since sys_created_by is a string, not a reference field.

Here is how I would handle this:

In your business rule, I would use the sys_created_by field to query the sys_user table and grab the user_name for that record.

Then, I would send that value in your SOAP request to the Web Service Import Set on Instance B. (Please note, you should not be going directly to the incident table on Instance B, but rather through a web service import set). Your Transform Map on instance B would take the user_ID and set it as the displayvalue for the opened_by field something like so:



target.opened_by.setDisplayValue(source.u_created_by);


That script snippet is not exact, nor does it likely use your values, but it should give you an idea of what I am talking about.