Copy Attachments from Incident to JIRA Issue using flow designer Spoke.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2021 11:37 PM
Hi,
I have a requirement to Copy attachments from an Incident record to JIRA Issue using the flow designer spoke. I have built below flow and I am able to copy the attachment, but for scenarios like when I have multiple attachments my flow is copying only the first attachment.
Scenario 1: For each single attachment added to the Incident, I want only that file to be copied into JIRA issue.
Scenario 2 : Assume a scenario when the incident record already has 2 attachments and when I attach the third attachment, I want only the third attachment to be copied into JIRA assuming the first two attachments are already copied into JIRA Issue.
Below are Options which I tried with no success. Please suggest any better approach to address this Issue. Thanks
Option 1 : Step 1. Lookup Attachment is always returning the first attachment, so always only the first attached file is getting copied into JIRA Issue. I tried For Each Loop condition also, when I use this it always copies all the attachments to JIRA, which will create duplicate copies.
Option 1 tried : Trigger when Attachment is added onto Incident record.
Option 2:
I also tried triggering the subflow from an On-Insert Business Rule on the sys_attachment table, but here also Lookup Attachment is always taking the first attachment on the Incident record, even-though I am passing the sysId of the second or third attachment file.
Option 2 tried : Trigger Subflow from an On-insert Business Rule on sys_attachment table.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2021 11:42 PM
Hi,
Since you are iterating over sys_attachment for that incident record you will get all the 3 attachment
For Option 1: When you are doing the Lookup action did you try to sort it by Created [A to Z] to get the latest attachment
Order By: Created a to z
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2021 08:40 AM
Hi Ankur,
Thanks for replying.
We do not have Order By selection option in "Look Up Attachment" Action.
and we cannot use "Look Up Record" action for doing attachment lookup, It shows sys_attachment table for selection, however we cannot pass the output of this action to JIRA "Copy Attachment" spoke. I already tried this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2021 05:34 PM
Hi Ravi,
Did you solution for this? I was struck with the same problem and could not get the solution. Please share the solution if you have resolved the issue.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2021 10:07 AM