In Portal 10.8.1, we share some web apps, maps and layers to the public, and to a group collaboration set up with our AGOL account. When going to the group in AGOL, the items aren't public facing, so we have to manually update the share for each item - again. I'm trying to create a script that updates all the AGOL items in that group to Public, but it fails when it comes to a Web Application with code attachment. I copied one such web app in Portal, removed the code attachment, shared it to AGOL collaboration group, but then it wouldn't open in AGOL at all.