How to send the last updated Attachment to JIRA using copy attachment action

Samiksha2
Mega Sage

Hi All,

I am working in JIRA-Request Management integration.

I have created flow designer when RITM is updated.

I have added one action to add attachment in JIRA when attachment added in RITM.

Samiksha2_0-1708344665033.png

But it is coping all the attachment instead of coping the last attachment added.

Please let me know how to send the last updated Attachment to JIRA using copy attachment action.

 

Thanks,

Sam

1 ACCEPTED SOLUTION

Martin iTSM
Tera Guru

Hey there,

to my knowledge there`s no OOTB functionality to just copy a single attachment / the latest attachement.
You need to lookup the attachment in the [sys_attachment] table and create a new attachment via script.
You need data from [sys_attachment] and [sys_attachment_doc] tables to create the new one / copy.

There`s a a post from Ankur Bawiskar (bit older one) explaining it: https://www.servicenow.com/community/developer-forum/is-there-any-way-to-copy-single-attachment-from...

Similar description from Harsh_deep:
https://www.servicenow.com/community/developer-forum/how-to-copy-single-attachment-from-the-multiple...


We did it in a similar fashion for a client and it works quite well.
So i guess you would need to do something like that in your flow via script unless there`s some other clever way i`m maybe unaware of 🙂

Hope this helps!

Cheers!

Martin


View solution in original post

1 REPLY 1

Martin iTSM
Tera Guru

Hey there,

to my knowledge there`s no OOTB functionality to just copy a single attachment / the latest attachement.
You need to lookup the attachment in the [sys_attachment] table and create a new attachment via script.
You need data from [sys_attachment] and [sys_attachment_doc] tables to create the new one / copy.

There`s a a post from Ankur Bawiskar (bit older one) explaining it: https://www.servicenow.com/community/developer-forum/is-there-any-way-to-copy-single-attachment-from...

Similar description from Harsh_deep:
https://www.servicenow.com/community/developer-forum/how-to-copy-single-attachment-from-the-multiple...


We did it in a similar fashion for a client and it works quite well.
So i guess you would need to do something like that in your flow via script unless there`s some other clever way i`m maybe unaware of 🙂

Hope this helps!

Cheers!

Martin