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

Vijayata Manche
Kilo Expert

Hi Ijaazops,

 

It seems like GlideSysAttachment is server side API and will not support in client script.

 

Try doing the same by business rule. following code may help you

 

var att_rec_sys_id='818885b6dbe4ab000b928b4b0b9619cc';//KB0010005

var problem_rec_sys_id=current.sys_id;

GlideSysAttachment.copy('kb_knowledge',att_rec_sys_id, 'problem',problem_rec_sys_id );

 

Please mark helpful or correct if it is a answer to your query.

 

Thanks,

VM1104

Hi VM1104,

What does the "current.sys_id" indicate. is it the sysid of the change_task form?

Thanks

Ijaazops