Copy all attachments from Idea to Demand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 08:26 AM
Hi,
I want to copy all the attachments which are present on Idea to Demand.
I have used After business rule with Insert for below code.
But the below code isn't working as per requirement. Can someone guide me where I need to correct.
Have attached screenshot for reference.
Thankyou.
(function executeRule(current, previous /*null when async*/ ) {
var demandTable = "dmn_demand";
if (GlidePluginManager.isActive('com.snc.project_management_v3')) {
demandTable = SNC.PPMConfig.getDemandTable(current.getTableName());
}
var demand = new GlideRecord(demandTable);
var dmnId = demand.insert();
demand.get(dmnId);
current.demand = dmnId;
current.stage = 'demand';
GlideSysAttachment.copy('idea',current.sys_id, 'dmn_demand', demand.sys_id);
var message = gs.getMessage("Demand {0} has been created");
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2025 10:11 PM
not yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2025 10:32 PM
how is idea table related to demand?
you have to define the field and then copy it to the record
check this link
copy attachment from idea to demand
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2025 10:48 PM