Office not giving NOC

Sir, I am working in a state government department. While working there, I got to know about a vacancy in a central government department which required the employees working in government offices to submit their application through proper channel. Proceeding honestly, I gave my office an application with the content that I wanted to appear in the exam for the job as the job carried higher grade pay and therefore, NOC was required to sit in the exam for the same. What I requested to them was just an NOC to appear in the exam and that too in the month of January. I required reply within one month so that I may be allowed to submit my application the vacant department. After five months, I got a shocking reply from my office. In the letter i received, It was written that the office cannot provide NOC to employees for further recruitment due to staff shortage. And as the job carries a higher grade pay, my application is taken as an intimation subject to condition that even upon my selection, i may not be relieved upon my selection. Sir, they said NO to me by this letter for the noc after my selection, whereas I just wanted NOC to appear in the exam. At least, I should have been given an opportunity to sit in the exam and the matter regarding NOC after selection should be considered later. Sir, they placed my application on record only as an intimation subject to condition that i may not be relieved even upon my selection. Then, what is the purpose left for giving intimation to the office if the office behaves so rudely with an honest employee. Sir, I wish to get better job in future. There is a vacancy that requires me to intimate my office and to produce noc at the time of interview. If I intimate my office, they would again show me a shocking letter like the one above which means that even if i get selected, i lose the job. I am 100% sure in the light of the above letter that they will never give me an NOC for going to a better job. If i mention to the desired department about my current job, they will ask for NOC and I will again lose the opportunity with respect to both points- time taken by my office to reply to my NOC request and denial of NOC even to sit in exam. Sir, I want better job. The office wants to bound me in the name of staff shortage. tell me what is best course of action I can do? I do not think I should intimate the office in the light of the above letter where they gave a condition to the intimation that I may not be relieved even upon my selection.Sir, please reply.