- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2020 02:00 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 06:07 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 02:38 AM
Thanks for the Answer.
But i need work_notes should not be mandatory when closed complete, incomplete and skipped if assignment group changes also.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 05:20 AM
You may create a new UI policy for this. Go to 'System UI' - UI Policies, click 'New'. Choose State as required in UI Policy conditions ('When to apply' tab) and add work_notes field to 'UI policy actions', where 'Mandatory' = False.
Please mark the related answer as a correct one, so others can benefit from this thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 12:18 AM
Hi
The requiremnet is
Please keep work notes mandatory only for state open , work in progress , pending and blocked when there is change in assignment group .
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 01:22 AM
Ok, then you should modify my script with the following:
var st = g_form.getValue('state');
if((newValue != oldValue) && ((st == 'open') || (st == 'wip') || (st == 'pending') || (st == 'blocked'))) // change to your state values
g_form.setMandatory('work_notes');
Please let me know if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 01:34 AM
Hello
Do i use this script from on change of assignment group ??
Thanks.