cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Uploading attachments to servicenow

ppotto
Deputy Chef II
Deputy Chef II

Hi,

I'm trying to build a recipe that triggers on a new/updated JIRA issue and creates a Servicenow ticket, including attachments and comments. The current challenge is getting the recipe to upload to the servicenow incident. I used the recipe at: https://app.workato.com/recipes/555682-new-updated-jira-issue-will-create-update-servicenow-incident...

And after my tweaks and tests, I'm stuck on the step "Upload the attachment via HTTP". I tried other ways directly using pills and failed uploading to sys_attachments and sys_attachment_doc, so it seems that the HTTP upload might be the only way to go. The example recipe does not provide clues as to what pills or text is required to make the upload work. On the invetigation path, I was able to use the ServiceNow API explorer POST method found at https://<instancename>[.]service-now.com/now/nav/ui/classic/params/target/%24restapi.do . That API endpoint cannot be used in the recipe since the input includes a manually uploaded file. I have a feeling that I might be missing something simple. 

Can someone point out the data pills or text I might need to make the example work or an easier way that the HTTP upload?

Cursor_and_New_Updated_Jira_Issue_will_create_update_ServiceNow_Incident_with_attachments__Real_-_Time____Workato.png

Thanks!

1 ACCEPTED SOLUTION

ppotto
Deputy Chef II
Deputy Chef II

With the help of Workato, this is resolved. The fix included url encoding the filename. If the filename was not url encoded, those files that included spaces and/or special characters might not be handled gracefully in the interaction between Workato and the SNOW instance where I was uploading the file. It seems that SNOW was not consistently handling the spaces or special characters in the file name from Workato and ending up in a weird state that also put the workato job in a weird state. After adding the url encoding, the job went from 3 hours down to seconds and everything worked. 

View solution in original post

6 REPLIES 6

ppotto
Deputy Chef II
Deputy Chef II

Excellent idea mppowe to test the email to eliminate a variable. I skipped the upload step and inserted an email step of the attachment. That worked, to my relief. I am apparently able to grab the attachment contents correctly using the email widget. 

Interestingly, I had someone at workato copy my flow, strip it down to the bare min get JIRA attachment then upload to servicenow part, then run it in there environment successfully. Then when them on the line, live with me, running their version of the recipe, it didn't work. There are a number of testing scenarios underway, and I'll post back here once I get more clarity on what might be the problem.

ppotto
Deputy Chef II
Deputy Chef II

With the help of Workato, this is resolved. The fix included url encoding the filename. If the filename was not url encoded, those files that included spaces and/or special characters might not be handled gracefully in the interaction between Workato and the SNOW instance where I was uploading the file. It seems that SNOW was not consistently handling the spaces or special characters in the file name from Workato and ending up in a weird state that also put the workato job in a weird state. After adding the url encoding, the job went from 3 hours down to seconds and everything worked.