- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on ‎04-27-2022 10:20 PM
Hi everyone I am
Step - 1) Since I am trying to integrate SAFe story record and JIRA Story I went with JIRA spoke. So, first go to servicenow store and request JIRA SPOKE installation to your instance.
Step -2) Now after setting up your creation flows we now come to copying the attachments but when we use a copy attachments action from JIRA spoke it asks for Issue ID and and attachment as in below Picture now to tackle that we can use "LOOK UP RECORDS" Action.
Step - 3) Now create a "LOOK UP RECORDS" action and fill out details like Table name,conditions and order by for reference see below pic,
Action - LOOK UP RECORDS
Table - SYS_ATTACHMENT
Conditions - Table SYS ID is "Your record SYS_ID
Order By - Created - Z to A or A to Z
Step - 4) Now we may have more than 1 attachment present so we use an "IF logic" see below pic for reference and we put condition as count greater than or is 1(to put this condition use data pill picker select the previous action and you will be able to see an integer object "count" see the below pic for reference )
Step -5) Now we got our condition in place but we need these attachments to be looped so that we can copy them so for that we use an flow logic called "FOR EACH ITEM IN" and just like before we use data pill picker to select our attachment(see below pic for reference)
Step -6) Now In Final step we use copy attachment and use data pill picker to fill out necessary details(see first pic for reference) and for attachment field part we navigate through data pill picker and select "FOR EACH ITEM IN" action(see below pic for reference) and for Issue id it is different for everyone(for us it was correlation ID).
Step -7) Now we are able to copy our attachments to jira but if the flow is being triggered continously or if used for update the record would be duplicated so for that we first have to add a custom choice field in sys_attachment table and give it 2 choices 1.YES
2.NO and now after doing this go to the flow we have configured and change the "LOOK UP RECORDS" Actions condition(see below pic for reference) to "and" "yours custom choice field name" is "NONE"
Step -8) No for the final step we go and add an "Update Record" action under copy attachment and fill out necessary details like record,table,field
Record - Use data pill picker and again select "FOR EACH" > Attachment record(JUST LIKE STEP 6)
Table - Automatically Populated(IF NOT SELECT SYS_ATTACHMENT)
Field - Select "yours custom choice field name" and set field value to be YES(see below pic for reference)
AND BOOM WE CAN COPY ATTACHMENTS TO JIRA AND ALSO AVOID DUPLICATES.
MARK HELPFUL IF YOU HAVE LEARNED SOMETHING NEW
Thanks,
Regards
- 5,016 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Pranav,
Thanks for the detailed documentation. We had a similar scenario and your documentation really helped.
Thanks,
Sudhangshu

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I think, if you trigger the flow on sys_attachment table with suitable set of conditions, then you won't need Foreach loop.
I am looking for Deletion of attachment, can you please let me know, how that can be achieved.
Kind Regards,
Swarnadeep Nandy
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @SwarnadeepNandy ,
For deletion of attachments using JIRA Spoke, we were able to achieve that by triggering the out of the box 'Delete attachment' action in JIRA spoke using a business rule. We can do that. We just need to copy the code snippet from the action.
Now the catch is, the Delete attachment action takes the attachment ID as it's input. So, to get that, we had to get the attachment IDs from JIRA using the 'Look up latest attachment' action in JIRA spoke. We copied that action and customized the code to get the attachment IDs which we could use in the 'Delete attachment' action.
Hope this helps!
Regards,
Sudhangshu
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Anyone encountered permission issues here?
I got an error something like:
Error: Either provided SysID of attachment record is incorrect or unknown error occurred.
Digging further, i got this:
IPaaSActionProbe | Error encountered fetching Attachment : Attachment does not exist or user does not have read permission on attachment with sysid <id removed>.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @adrian08,
We're receiving the same error. Were you able to find a solution for it?
Thanks,
Josh Pirozzi
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Josh Pirozzi you have to ceate a Cross-Scrope Privilege (sys_scope_privilege) so JIRA can read the sys_attachment table
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@adrian08 I had the same error "Error encountered fetching Attachment : Attachment does not exist or user does not have read permission on attachment with sysid" and I created the Cross-Scope Privilege.
However, I'm still getting the same error.
Here is a screenshot of my Cross_scope Privilege:
Was there anything else you might have done to fix your issue?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
FYI for others experiencing this.
I found a fix for my issue. It had to do with our mid server service account needing read access to sys_attachment table.