How do miter up and bend and turn corner

How do i make this miter flange go up the bend and around the corner(it only letting me do one or the other, so i have to use multiple miters with gaps).
I made this by starting the green miter on the bottom and then sketching on the end surface for the 2nd miter, but i had to have a gap for it to unfold. 


What do i do to have one continuous miter or alternatively merge the circled gaps