Donot close change request unless all change tasks are closed?

Deepika61
Tera Contributor

Hi all,

We have requirement that "Donot close change request unless all change tasks are closed", So for that there is OOTB business rule "Check open change_tasks", So it abort the operation and throw an error message,

But here my concern was like, when i click on close ui action  before closing tasks, then it will throw a error message but the state was moved to "closed",. because of that customers are thought that it was closed.

So is there any way that if we click close button before close the tasks , it wil, throw error and state will back to previous state value?

Please help me on this 

Thanks

Deepika

10 REPLIES 10

Hi,

best practice I already mentioned above.

Update the UI action condition to show the button only when no open change tasks are there for the current CHG.

If my response helped please mark it correct and close the thread so that it benefits future readers.

regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar 

Thanks for that

Can you please provide the condition script for no open change tasks that we need to add?

Thanks

Deepika

Hi,

the same logic which is present in the BR can be included in condition

like this

Your Existing Condition && !(new ChangeRequest(current).hasOpenTasks())

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar 

Thanks for the code

I made the changes, but still they have an option like in state they can change  state choice   to closed before closing the tasks then same senario like error message comes, with this they might get confuse

Can you please provide the solution for this?

Thanks

Deepika

 

Hi,

are you sure all change tasks are closed for this CHG?

share your complete UI action condition along with screenshot

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader