Making Worknotes mandatory when changing assignment group in any state of catalog task .

Chaithu3
Tera Contributor

VERY IMPORTANT..  URGENT..!!

Whenever an assignment group is changed in any state(i.e. open , work in progress , blocked , pending , onhold , close complete , close incomplete , close skipped) worknotes should be mandatory . User should provide reason for assignment group change.

Please create a new new business rule on Catalog Task table(sc_task ) which runs on update call .
Below are the filter condition for BR
State is Anything and Assignment group changes
worknotes should be mandatory.

 

ANYONE PLEASE HELP ME WITH A CODE IN BUSINESS RULE

@Ankur Bawiskar  @Pradeep Sharma 

1 ACCEPTED SOLUTION

P-Rudenko-SN
ServiceNow Employee
ServiceNow Employee

So let me explain to you what my first script does. The code is triggered, once you set the NEW value into the assignment group. It checks the following:

IF the new value of 'Assignment Group' is different than the old value (the one was there when the form is loaded) AND the 'State' field is 'Open/Work in Progress/Pending' then it makes the 'Work notes' field mandatory. Please NOTE: if you changed the assignment group, set the status to 'Open/Work in Progress/Pending' and the work note became mandatory, then IF you do not submit the for but try to change the state to not of these there above (let's say 'Closed complete'), then, OF COURSE, the work notes will REMAIN to be mandatory because the 'Assignment group' is still other then it was when the form is loaded.

You cannot expect the 'work_notes' field to be set back to the optional if you change the state to another one BUT the Assignment Group field contains the new value. You have to save the ticket and afterward change it to the new state. The client script is constantly checking the assignment group field. This is its nature, otherwise, you can't control the change of assignment group field. I hope it now finally makes sense.

 

View solution in original post

28 REPLIES 28

P-Rudenko-SN
ServiceNow Employee
ServiceNow Employee

Hello, why don't you want to achieve this via the UI Policy? Must be easier and even with no coding.

Sourav16
Kilo Guru

Hi,

You don't need a business rule for this. It can be acheived via a simple UI policy.

Create an UI policy on sc_task table.

Conditions : Assignment group changes AND Assignment group is not empty

UI polcy actions : Set Work Notes Mandatory = true   

 

Seems like the 'Assignment group CHANGES' condition is not available for the UI Action.

Single catalog task and multiple catalog task : -

1 . open any request which has single catalog task with ITIL role user
2 . open the catalog task generated
3 . change the assignent group to any other assignment group and click on save - worknotes should be mandatory
3a . change the state to WIP and provide different assignment group and click on save - worknotes should be mandatory
3b . change the state to pending and provide different assignment group and click on save - worknotes should be mandatory
3c . change the state to onhold and provide different assignment group and click on save - worknotes should be mandatory
3d . change the state to pending customer and provide different assignment group and click on save - worknotes should be mandatory
3e . change the state to pending vendor and provide different assignment group and click on save - worknotes should be mandatory
3f . change the state to blocked and provide different assignment group and click on save - worknotes should be mandatory

 

IT SHOULD FULFILL ALL THIS ??