Your total taxable income will be the amount in Box 1 of your W-2. The fact that Box 15 shows two states just means that your employer withheld taxes for both states. Your Box 1 income is taxable by both states. but your home state of MA should have given you a credit for the tax you paid to RI. Look at Line 30 of your 2023 Massachusetts Form 1 to see if your MA return included that credit.
The credit prevents your income from being double-taxed
**Answers are correct to the best of my ability but do not constitute tax or legal advice.