
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 09:18 PM
Our customers created case via the web portal. Our engineers work in the incident. All the updates that should be visible for the customer are synchronized between case and incident. When a customer adds an attachment to the case, it is not visible in the incident. How can I make this work? I checked the forum and the documentation, but was not really able to find a solution. Thank you in advance for your help!
Solved! Go to Solution.
- Labels:
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2019 04:51 AM
My pleasure and please start working on scripting by joining the developer's learning on https://developer.servicenow.com.
Kindly,mark the answer as correct if this helps you out so,this questions could be considered as closed for other community members.
Regards,
Munender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2019 05:12 AM
Hi,
As i mentioned earlier,I have check this by running on my personal instance,so version won't be a problem.
As I tested by copying attachments from problem to incident,Their could be some problem in the dictionary names which we ar eusing in our code.Please check whether you have selected the correct condition for when to run also.
If not able to get it please share the code .
Regards,
Munender

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2019 10:17 PM
It works!!! 😄 I had to use the name of the table and not the label name of the table. Now I just have to make it possible that the attachment is removed from the incident when it is removed from the case. Once more, thank you very much for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2019 02:26 AM
Yah,we use only the dictionary name of all fields and table not label name for scripting.
My pleasure
Munender

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2019 02:27 AM
Hello Munender,
I was trying to do the copying of the attachment the other way around, so from the incident to the case. I changed a few things in the script, but I seems that I guess I was thinking to simple.
1.Write a business rule on sys_attachment table
2.The type of business rule is after and action is on insert/update
3.When to run -->table name is incident
4.Script would be:
var incgr = new GlideRecord('incident');
incgr.addQuery('sys_id',current.table_sys_id);
incgr.query();
if(incgr.next()){
var Gr = new GlideRecord('sn_customerservice_case');
Gr.addQuery('number',incgr.sys_id);
Gr.query();
if(Gr.next())
{
GlideSysAttachment.copy('incident',incgr.sys_id,'sn_customerservice_case',Gr.sys_id);
Gr.update();
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 09:37 PM
Thank you guys. You rock!!!