
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 05:56 AM
Hello together
We have a UI Action in the Incident, through which a CI Owner can be informed about the Incident.
Subsequently, a business rule is triggered which sends the incident as a PDF to the stored CI owner.
Everything works fine, but now we need to check if the user is active. If yes, the process should run as today and if not, a message should be displayed that the user is inactive (the mail is not sent if the user is not active).
Can someone help me with the code because I can not implement this myself?
Thanks for inputs and greetings
Alex
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 07:02 AM
Sorry just realised you are in UI action at server side
if(current.u_affected_service.assigned_to.active == true ||current.u_affected_service.assigned_to.active == 'true')
{
gs.eventQueue('wid.notify.ci_owner', current, current.u_affected_service.assigned_to, gs.getUserID());
gs.addInfoMessage(gs.getMessage('The CI owner of this incident will be notified'));
}
else
{
gs.addInfoMessage('User is not active');
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 06:03 AM
Hi
You want to check if Affected Service Assigned to is Active?
If yes then your script simply do below
if(current.u_affected_service.assigned_to.active == true ||current.u_affected_service.assigned_to.active == 'true')
{
gs.eventQueue... //Add code here
}
else
{
alert('User is not active');
return false;
action.setRedirectURL(current);
}
Hope this helps
Thank you
Prasad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 06:27 AM
Hi
Thanks for your code and the script is looking now like this:
if(current.u_affected_service.assigned_to.active == true ||current.u_affected_service.assigned_to.active == 'true')
{
gs.eventQueue('wid.notify.ci_owner', current, current.u_affected_service.assigned_to, gs.getUserID());
gs.addInfoMessage(gs.getMessage('The CI owner of this incident will be notified'));
}
else
{
alert('User is not active');
return false;
action.setRedirectURL(current);
}
Unfortunately there is still a parsing error at the "return" (outside of function).
Thanks again for your support
Regards Alex

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 06:35 AM
Hi
Try this sir
if(current.u_affected_service.assigned_to.active == true ||current.u_affected_service.assigned_to.active == 'true')
{
gs.eventQueue('wid.notify.ci_owner', current, current.u_affected_service.assigned_to, gs.getUserID());
gs.addInfoMessage(gs.getMessage('The CI owner of this incident will be notified'));
}
else
{
alert('User is not active');
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 06:47 AM
Thank you and we are approaching the finish line.
The mail is no longer sent but the message does not appear and I end up on the Incident list view.
Regards
Alex