Change request state from code

Jul 23, 2013 at 2:06 PM

I'm trying to write a custom code activity that redirects a build to a different build definition according to certain criteria and then sets the original build status to "Succeeded".
I managed to get it to work fine except for one problem - when I need to redirect a build with Reason = 'CheckInShelveset', the build is automatically set to "Check-in rejected" and the request is marked as "Check-in rejected" in the 'Request Summary' section.
What I want to do in this case is to change the request state to "No changes checked in" instead, but I can't figure out how to do this in the code.
Any suggestions would be welcome.