Employee Form for "Collect employee input" task type not working as expected

Kiran Raddy
Tera Expert

I am taking Employee input from service portal using HR Task type Collect Employee Input and Employee form. There is only 1 record matching the condition. Question type is string. Target field is also string.

find_real_file.png

 

Taking user input from esc portalfind_real_file.pngNot mapping the value to the backend HR Profile field. 

find_real_file.png

Has anybody encountered this configuration issue?

 

1 ACCEPTED SOLUTION

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

@kiranreddy Have you submitted a Now Support (Hi) issue for this? There is a known issue that is addressed in Quebec.

This is specific to Paris, which you have listed as the version you are working on. In short, within the widget HRJ Task Collect Information, it is possible that the method - $scope.surveyClick() is called before the survey instance state is complete , due to which the mapping of fields are not processed

1) In widget Widget HRJ Task Collect Information :
a) Client Controller : Remove the method $scope.surveyClick();
b) HTML : Remove the call to surveyClick():

-- < div ng-if="data.takeSurveyWidget">

c) Server script : Remove the following lines :
if (input && input.action === 'setTaskFinished') {
new

EmployeeDataCollection().saveUpdatedData(data.sys_id);


return;
}

2) The following BR "Reset invoking task status " is modified. The method saveUpdatedData is been called from BR only after survey instance is completed .

var states = {
'ready': 10,
'wip': 18,
'complete': 3,
'canceled': 7
};
var gr = new GlideRecord('sn_hr_core_task');
if (gr.get('survey_instance', current.sys_id)) {
if (states.hasOwnProperty(current.state))
gr.setValue('state', states[current.state]);
else
gr.setValue('state', 10);
gr.update();
if (gr.state == '3') {
if (gr.getValue('hr_task_type') == 'collect_Information')
new

sn_hr_sp.EmployeeDataCollection().saveUpdatedData(gr.sys_id);


gs.addInfoMessage(gs.getMessage('The to-do "{0}" has been completed ', gr.getValue('short_description')));
}
}

3) Business Rule :"Reset invoking task status" "When to run" should be changed from before to after.
 
 
Regards,
Mike
 

View solution in original post

2 REPLIES 2

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

@kiranreddy Have you submitted a Now Support (Hi) issue for this? There is a known issue that is addressed in Quebec.

This is specific to Paris, which you have listed as the version you are working on. In short, within the widget HRJ Task Collect Information, it is possible that the method - $scope.surveyClick() is called before the survey instance state is complete , due to which the mapping of fields are not processed

1) In widget Widget HRJ Task Collect Information :
a) Client Controller : Remove the method $scope.surveyClick();
b) HTML : Remove the call to surveyClick():

-- < div ng-if="data.takeSurveyWidget">

c) Server script : Remove the following lines :
if (input && input.action === 'setTaskFinished') {
new

EmployeeDataCollection().saveUpdatedData(data.sys_id);


return;
}

2) The following BR "Reset invoking task status " is modified. The method saveUpdatedData is been called from BR only after survey instance is completed .

var states = {
'ready': 10,
'wip': 18,
'complete': 3,
'canceled': 7
};
var gr = new GlideRecord('sn_hr_core_task');
if (gr.get('survey_instance', current.sys_id)) {
if (states.hasOwnProperty(current.state))
gr.setValue('state', states[current.state]);
else
gr.setValue('state', 10);
gr.update();
if (gr.state == '3') {
if (gr.getValue('hr_task_type') == 'collect_Information')
new

sn_hr_sp.EmployeeDataCollection().saveUpdatedData(gr.sys_id);


gs.addInfoMessage(gs.getMessage('The to-do "{0}" has been completed ', gr.getValue('short_description')));
}
}

3) Business Rule :"Reset invoking task status" "When to run" should be changed from before to after.
 
 
Regards,
Mike
 

Kiran Raddy
Tera Expert
@michaelj.sheridan Thank you so much. It solved the problem!!!