Trigger after insert BR only when condition satisfy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 02:19 AM
Hi,
I have created a after insert and update BR with filter conditions as assignment group is AB.
I have created two functions in script include which is called by the BR when record is inserted or updated.
Now the insert function should trigger only when the above condition gets satisfied for the first time and from next time onwards it should trigger the update function(because the condition has already been satisfied once and insert was trigerred)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 02:51 AM
This cant be possible, I have tried in my PDI it is working properly
Can you try creating two BRs, One is with after-insert and second is with after update and call the script there accordingly
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 03:56 AM
The update is not the problem, but the insert shuld happen only once the assignment group is AB. Also please note that the assignment group for the ticket is initially not AB but is changes to AB manually only after the ticket is created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 02:53 AM
Hello @tanz ,
Please check the screen shots, for me this is working fine.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
if (current.operation() == 'insert') {
gs.info("@@Harsh BR Insert");
} else if (current.operation() == 'update') {
gs.info("@@Harsh BR Update");
}
})(current, previous);
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 03:10 AM
Once you add an assignment group in filter this is not working. Also the use case is change the assignment group to AB only after the ticket is created.
This is actually considered an update not an insert. could you please help with suggestion here.