As mentioned on Issue #193584, line numbers (ID: line) for item fulfillments are not guaranteed to be sequential and most likely will not match the line numbers in their originating transactions (sales orders/transfer orders). This can be demonstrated with the following steps:
1. Create and save a Transfer Order with multiple line items.
2. After creating the Transfer Order, approve it (if needed) and click the Fulfill button.
3. Run the script below on the Script Debugger:
var rec = nlapiLoadRecord('transferorder', 8128); //change 8128 with internal ID of the transfer order
var rec1 = nlapiLoadRecord('itemfulfillment', 8129); //change 8129 with internal ID of the item fulfillment
for(var i=0; i<rec.getLineItemCount('item'); i++)
var lineField = rec.getLineItemValue('item', 'line', i+1);
var lineField1= rec1.getLineItemValue('item', 'line', i+1);
The logs of the debugger will show that the values for "lineField" and "lineField1" are different on each iteration.