Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

copy sctask attachments - to rtim

nameisnani
Mega Sage

Hi Team ,

 

can anyone please help me on this requiement .

 

Ony for particular catalog item ' Snow Support ' 

 

whenever in sctask we have attached any attachment . the same to should copy to ritm .

 

how to configure , can any one please help me .

 

@Ankur Bawiskar  Please help me here 

11 REPLIES 11

@Bhavya11 

 

It should be only for particular catalog item “ snow support “ 

 

now please update

OlaN
Tera Sage
Tera Sage

Hi,

In my opinion attachments should never be copied this way, it will only lead to duplication of data, which is unnecessary most times.

Instead, I propose that you create a simple Flow that moves the attachment from the SCTASK to the RITM when this scenario happens.

It shouldn't be hard to configure, reach you if you want an example.

Ravi Gaurav
Giga Sage
Giga Sage

Hi @nameisnani 

Follow the below video to copy attachment which I have created.
https://www.youtube.com/watch?v=4P-AUaNQ8EE&list=PLKH9bPqlw1neHQZWQpYXHKy7LGiG9lhZn

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
Hi Youtube Family, I am Ravi Gaurav. I am Expert in ServiceNow . Welcome to my youtube channel. If you guys enjoyed it, make sure to Like👍 , Comment💬 and Subscribe❤️ _________________________________________ Copyright Disclaimer : All Rights to VideoLabel Co. & No Copyright infringement intende...

Ankur Bawiskar
Tera Patron
Tera Patron

@nameisnani 

I already shared solution for your same question in another thread.

sharing here again

you can use after insert business rule on sys_attachment

Condition: current.table_name == 'sc_task'

Script:

(function executeRule(current, previous /*null when async*/ ) {

    // Add your code here
    var gr = new GlideRecord("sc_task");
    gr.addQuery("sys_id", current.table_sys_id);
    gr.addQuery("request_item.cat_item.name", "ServiceNow Suppor");
    gr.query();
    if (gr.next()) {
        new GlideSysAttachment().copy("sc_task", gr, 'sc_req_item', gr.request_item.sys_id);
    }

})(current, previous);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@nameisnani 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader