- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 05:46 AM
condition = current.table_name == "incident"
When to run : After Insert/Update
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GlideRecord("incident");
gr.addQuery("sys_id", current.table_sys_id);
gr.query();
gs.log("===>record exists", gr.next());
while(gr.next()) {
gs.log("===>record glide", gr);
//fi = gr.getElement('isAttachmentUpdated');
gr.setValue('isAttachmentUpdated', 'Updated'); //custom field isAttachmentUpdated
gr.update();
}
// Add your code here
})(current, previous);
Note: I'm able to receive the "record exists" debug as "true" but not able to get the log inside while loop. Please help me understand what is the issue fix as the custom field (isAttachmentUpdated) on incident is also not getting updated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2020 11:00 PM
Hello
If this has answered your question, kindly mark the comment as a correct answer so that the question is moved to solved list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 08:05 AM
Sure, I will try this and then mark. Thanks for the suggestion. Also, can you suggest me the business rule way as i have my business rule on task so that whenever events get fired from incident, problem, change request etc i can capture in a single business rule. If i create events then i might end up with creating different events for Incident, problem and so on. So, I would really appreciate if you can provide solution from BR perspective.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 08:07 AM
No problem. you are welcome.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 08:09 AM
Also, can you suggest me the business rule way as i have my business rule on task so that whenever events get fired from incident, problem, change request etc i can capture in a single business rule. If i create events then i might end up with creating different events for Incident, problem and so on. So, I would really appreciate if you can provide solution from BR perspective.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 08:13 AM
fro Br, you need to perform an update on the table. But whatever you do in the BR you can do with Script action. Just have the event and script action on task table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 08:15 AM
Sure!!
Will try this way and let you know.