I worked in 3 different States in 2019, and when filing my state tax, I am being asked to "Enter the non-State (in this case Massachusetts) portion of the amount you paid during 2019 to social security (FICA), railroad, medicare, US or Massachusetts retirement"? How would I know how much is for each State portion?
Take each state and divide by the total. Take the MA income and divide it by your total income. Multiply that percentage times the total of each category.
For example:
If you need it the other way around, you can do the non-MA
If all income on the W2 was MA, no math required. Just look at the form.