Here is an example of how to initialize a profile screen attribute of a task. This refers specifically to the text area on a profile screen where you have to insert a function of the form: function init (FieldContext).
Identity Portal 14.5 & v15
In this example, you want to populate the manager field on the profile screen with the administrator's (person running the modify user task) last name. Here is how you would use the init function to accomplish this:
function init(FieldContext)
{
var adminDN=FieldContext.getAdministrator().getUniqueName();
var up = FieldContext.getUserProvider();
var curAdmin=up.findUser(<UserDN>,null);
FieldContext.setValue(curAdmin.getAttribute("eTLastName"));
}