- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2018 11:17 PM
I am trying to close a change management task which requires a mandatory attachment.
i tried using
Solved! Go to Solution.
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 01:59 AM
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 );

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 12:09 AM
GlideSysAttachment.copy(source_table_name, source_record_sysid, target_table_name, target_record_sysid);
what values you are using inside this function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 01:34 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 01:59 AM
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 );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 04:52 AM
Hi Rohit,
Thanks a lot it worked. Cheers!!!.
Ijaazops