This extension to the already answered question Do ADA Refactor/JARVIS Virus count as a portal capture for missions? that states that flipping a portal to your own faction counts as a capture or upgrade of the portal.
There are cases where a portal is already owned by your faction and maxed out such that an portal upgrade is impossible. Does flipping the portal via ADA Refactor or JARVIS Virus to the enemy's faction count as having captured the portal since it will be under your codename?