ATF: How to bypass mandatory attachment in change management module to close the task.

Ijaazops
Kilo Expert

I am trying to close a change management task which requires a mandatory attachment.

i tried using 

GlideSysAttachment.copy(source_table_name, source_record_sysid, target_table_name, target_record_sysid);
 
Although the test passes there is no attachment available. please provide an alternative for this without changing the client script.

find_real_file.png

1 ACCEPTED SOLUTION

I think second id would be dynamic as it ATF creates dummy records. So, i think first you should query the change_task record by the Record Query Step and then run add a Run Server Side Script step to copy the attachment to the change_task record.

You can use this in that step:

var change_task_id = steps('record_query_step_sys_id').first_record.toString();

GlideSysAttachment.copy('change_request', '500ad86c4fdeaf48e18d82818110c73a', 'change_task', change_task_id );

View solution in original post

6 REPLIES 6

Rohit Kaintura
Mega Guru

GlideSysAttachment.copy(source_table_name, source_record_sysid, target_table_name, target_record_sysid);

 

what values you are using inside this function?

Hi Rohit,

GlideSysAttachment.copy('change_request', '500ad86c4fdeaf48e18d82818110c73a', 'change_task', '92f946c24f1ee30ce18d82818110c7f8');

The first sysid is a record with already an attachment, the second sysid is the change_task forms sysid.

 

Thanks.

Ijaazops

I think second id would be dynamic as it ATF creates dummy records. So, i think first you should query the change_task record by the Record Query Step and then run add a Run Server Side Script step to copy the attachment to the change_task record.

You can use this in that step:

var change_task_id = steps('record_query_step_sys_id').first_record.toString();

GlideSysAttachment.copy('change_request', '500ad86c4fdeaf48e18d82818110c73a', 'change_task', change_task_id );

Hi Rohit,

 

Thanks a lot it worked. Cheers!!!.

 

Ijaazops