'Save as attachment' on REST step fails with error


Description

You are creating an action in Flow designer that will get a file from Jira and upload it as an attachment to a record in ServiceNow.
However using the "Save As Attachment" feature to save to the record you can notice in the logs:


Operation(Upload Attachment.f9f7796edb476050002c3307f496195e) failed with error: java.lang.NullPointerException
at com.snc.process_flow.integration.MidAttachmentWrapper.saveResponseAsAttachment(MidAttachmentWrapper.java:118)
at com.snc.process_flow.operation.AbstractHttpOperation.processResponseAttachment(AbstractHttpOperation.java:389)
at com.snc.process_flow.operation.HttpOperation.processResponse(HttpOperation.java:287)
at com.snc.process_flow.operation.AbstractHttpOperation.requestAndProcessResponse(AbstractHttpOperation.java:131)
at com.snc.process_flow.operation.AbstractHttpOperation.invoke(AbstractHttpOperation.java:111)
at com.snc.process_flow.operation.RetryableIntegrationOperation.run(RetryableIntegrationOperation.java:46)
at com.snc.process_flow.engine.Operation.execute(Operation.java:165)
at com.snc.process_flow.engine.ProcessEngine.executeOps(ProcessEngine.java:497)
at com.snc.process_flow.engine.ProcessEngine.run(ProcessEngine.java:413)
at com.snc.process_flow.engine.ProcessAutomation.run(ProcessAutomation.java:66)
at com.snc.process_flow.engine.MidProcessAutomation.messageFlow(MidProcessAutomation.java:55)
at com.service_now.mid.probe.IPaaSActionProbe.probe(IPaaSActionProbe.java:101)
at com.service_now.mid.probe.AProbe.process(AProbe.java:104)
at com.service_now.mid.queue_worker.AWorker.runWorker(AWorker.java:122)
at com.service_now.mid.queue_worker.AWorkerThread.run(AWorkerThread.java:20)
at com.service_now.mid.threadpool.ResourceUserQueue$RunnableProxy.run(ResourceUserQueue.java:647)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Release or Environment

All

Resolution

First please make sure MID server is up and running and it does not require revalidation.

If this is done, make sure the MID server has permissions to read the table you use in the flow ( ex: incident).

You can test this by impersonating MID server user and access the record in the UI.

If MID server user cannot access the record, give the right permissions to see the record and try testing flow action again.

Note: For incident table there is a BR called "incident query" which you could disable if it is not serving any purpose.