Notification on sc_task table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2015 12:08 AM
Hello,
I have a notification on sc_task table where I am trying to add a condition, when the request item is on specific stage, notification should trigger.
So far I have included the condition with the AND statements provided:
Request item.Stage contains 'Stage Name'
but notification doesn't seem to triggered.
I have also tried including it as an advanced condition, with following script:
var answer = false;
condition();
function condition(){
var gr = new GlideRecord('sc_req_item');
gr.addQuery("sys_id",current.request_item);
gr.query();
if(gr.next()){
if(gr.stage == 'Stage Name''){
answer = true;
}
}
return answer;
}
I have used a similar script on other notification and they work fine. The only difference is that working notifications are calling on approvals table and above calls on the tasks.
I am not great at scripting, and I get the sense the addQuery might be wrong. Please help.
Thank you so much in advance.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2015 09:41 AM
Hello Arnie,
Yes, I have included the value and not the name. Unfortunately it is still not being picked up in notification script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2015 09:59 AM
Can you please share a screenshot of the workflow activity?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2015 10:11 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2015 03:37 AM
The stages are workflow created. So you cant access those stages in the condition builder. But you should be able to use those in the script.
And why don't you trigger the notification using the workflow notification activity in your workflow? It would be easier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2015 10:20 AM
Hello Tanaji,
I tried triggering notification through script:
if(current.request_item.stage == 'verify')
answer = true;
else
answer = false;
stage on workflow is not being identified by the task. I tried also including the notification using the workflow activity and it did not triggered either. I am a bit confused as to why would it not trigger even when including it through the workflow.
Any ideas?