
- 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 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 07:09 AM
Great it works and thank you very much
Regards
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2022 10:25 AM
Hi
Can you add the validation if the cmdb_ci Owner is active on "UI Action condition".
current.cmdb_ci.owned_by.active
This way the action name will only be displayed if the owner is active.
Regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2022 12:20 AM
Hi
Thanks for your input.
An interesting approach. From a process point of view, I prefer the other variant because we know that the user is disabled (if the button does not appear, there is confusion in the service desk).
Thanks anyway and as I said, would also be an option
Greetings
Alex