Bulk changing attestation respondents

LJ3
Kilo Expert

When staff leave, how can we bulk change the respondents on the attestations assigned to them?

I tried using the below script, but it does nothing unfortunately (even though it gives me a long list of re-assigned, it doesn't actually reassign):

var actualRespondentsSysID = '(currentusersys_id)';
var newRespondentsSysID = 'newusersys_id';
var gr = new GlideRecord('sn_compliance_control');
gr.addQuery('Respondents', actualRespondentsSysID);
gr.addQuery('state!=retired');
gr.query();
while (gr.next()) {
gr.Respondents = newRespondentsSysID;
gs.info('Control Attestation ' + gr.number + ' re-assigned');
gr.setWorkflow(false); // Optional: Do not run any other business rules (can only be executed in Global scope)
gr.update();
}

I can export the xml and replace the <respondents>SYID</respondents> then re-import, I've tested this but this isn't ideal if a user leaves who is the owner and attestation respondent to a lot of controls...

 

1 ACCEPTED SOLUTION

jing3
Mega Guru

The proper step is to cancel any existing attestations and recreate them with the correct respondents (using out of box processes). Assuming that the Attestation respondents is the Profile Owner (Entity Owner), and thus the Control Owner, use the following steps:

1. find the Profile (Entity) this person own, uncheck "active", then "update", this will retire all related records (include cancel all outstanding Attestations)

2. Change the owner of the Profile (Entity)  to the right person,  check "active" again, update, this will set Contorl(s) in "draft" mode

3. bulk change the owner of the control(s) to the right owner

4. bulk change the control(s) status to "Attest", new Attestations will be created. 

 

 

View solution in original post

17 REPLIES 17

LJ3
Kilo Expert

Further to the above, it seems I can only edit the xml on certain record, importing xml on those with a compliance status gives a java.sql.BatchUpdateException: Duplicate entry 'longstring'  for key 'content'

jing3
Mega Guru

The proper step is to cancel any existing attestations and recreate them with the correct respondents (using out of box processes). Assuming that the Attestation respondents is the Profile Owner (Entity Owner), and thus the Control Owner, use the following steps:

1. find the Profile (Entity) this person own, uncheck "active", then "update", this will retire all related records (include cancel all outstanding Attestations)

2. Change the owner of the Profile (Entity)  to the right person,  check "active" again, update, this will set Contorl(s) in "draft" mode

3. bulk change the owner of the control(s) to the right owner

4. bulk change the control(s) status to "Attest", new Attestations will be created. 

 

 

Hello Jing, I see this is an older thread and hope you can help me. It would be very helpful if you could supply screenshots or if there is a thread that discusses this in more detail. I'm a bit lost and have been manually changing large numbers (800 +) of control attestations. 1) How do I find the Profile this person owns? do I need certain permissions? 2) How do I bulk change the owner of the control to the right person? How do I bulk change the "attestation respondent". 4) How do I bulk change control status to "Attest"? Can I bulk change Status from "Monitor" to "Draft"?

Hi Paul, I had stumbled on this thread a few months ago, and unfortunately the advice given wasn't very helpful. Same as you I had a large number of attestations with multiple respondents from entity ownership changes. I updated the OOB BR 'Update respondents when owner changes' to delete the previous entries. Hope this helps.