VTB: Add Primary Assignee field doesn't honor advanced reference qualifier (current refers an empty/undefined GlideRecord object)


Description

VTB: Add Primary Assignee field doesn't honor advanced reference qualifier (current refers an empty GlideRecord object)


Steps to Reproduce

1. Open your London instance.
2. Create a new script include via System UI > Script Includes > New, with the following details for example:
----- Name: TestInclude
----- Script:
var TestInclude = Class.create();
TestInclude.prototype = {
initialize: function() {
},
testFunction: function(){
gs.log("Triggered " + current, "Nishit");
},
type: 'TestInclude'
};
3. Open the "assigned_to" dictionary field (defined on "task" table).
4. Switch to "Advanced view" if needed.

#### Scenario 1 ####:
5. Under Reference Specification form section, update the following:
----- Use reference qualifer: Advanced
----- Reference qual: javascript:gs.log("Triggered " + current.sys_id, "AdvancedRefTrigger");
#### End of Scenario 1 ####

#### Scenario 2 ####:
5. Under Reference Specification form section, update the following:
----- Use reference qualifer: Advanced
----- Reference qual: javascript:new TestInclude().testFunction()
#### End of Scenario 2 ####

6. Open incident list and filter with [Assigned To] [is empty].
7. Right-click on "State" field and click "Show Visual Task Board" => Will create a new board.
8. Click one of the cards => Pop-up opens => Click "Add Primary Assignee".
9. Check server logs (with Source field filter being "AdvancedRefTrigger")

Actual: Returns "undefined"
Expected: Shall return sys_id of the record.

Works fine on the normal form view of the respective incident record if checked.

Workaround

After carefully considering the severity and frequency of the issue, and risk of attempting a fix, it has been decided not to address this issue. We do not make this decision lightly, and we apologize for any inconvenience. If you have any questions regarding this problem, contact ServiceNow Customer Support.


Related Problem: PRB1313555