How to set 'close code' choice field when change request form's state changes to cancelled?

Nitin21
Tera Contributor

How to set 'close code' choice field in change request form to 'Cancelled' when the state of change request changes to 'Cancelled' ?

AndersBGS
Tera Patron

Hi @Nitin21 ,

 

The close code can be set by a business rule so whenever change request is cancelled the closed code will change to something...

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Hi thanks, I did write an 'after' business rule, but it did not set the choice field after the change request is cancelled. However, the message was shown. Do i need to write script in advanced section, if so can you please help with the script.

 

Try below code in script section.

 

(function executeRule(current, previous /*null when async*/) {
current.close_code="successful_issues"; // Change the value of close code
current.update();
   
})(current, previous);
 
 
Thanks.

View solution in original post

Thank you! Dhananjay. It worked. 🙏