FYI: this code works fine, but note that select2 does also allow you to directly call jQuery.val() on the element if you want to, you just have to trigger change afterwards so select2 can update itself. So an alternative would be:
`cj('#status_id').val(partiallyPaidStatusId).change();`