- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 10:39 AM - edited 11-23-2023 10:58 AM
Hi All,
I have updated the condition in 'Propose Major Incident' UI Action as per the business requirement.
from
(new sn_major_inc_mgmt.MajorIncidentTriggerRules(current)).canProposeMIC()
to
(new sn_major_inc_mgmt.MajorIncidentTriggerRules(current)).canProposeMIC() &&(gs.getUser().isMemberOf(current.assignment_group.toString()) || (gs.getUser().current.assignment_group.manager) || gs.getUser().isMemberOf('IT Operations') || gs.getUser().isMemberOf('Services') || gs.getUser().isMemberOf('Incident')) && (current.major_incident_state != 'proposed' && current.major_incident_state != 'accepted')
So this should be visible to the following people.
1) Services group members
2) IT Operations group members
3) Incident group members
4) Current assignment group members and that group's manager from the incident
But this condition is not working and everyone is able to see the UI action button on the incident form. We have recently upgraded to Vancouver from Tokyo.
Please assist asap.
Thanks & Regards.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 05:23 AM
Hi @Joshuu ,
Try add () before the new conditions , like below:
(new sn_major_inc_mgmt.MajorIncidentTriggerRulesSNC(current)).canProposeMIC() && (gs.getUser().isMemberOf('IT Operations Center Support') || gs.getUser().isMemberOf('Service Desk') || gs.getUser().isMemberOf('Incident Management') || gs.getUser().isMemberOf(current.assignment_group.toString()) || (gs.getUserID()==current.assignment_group.manager))
Regards,
Clara
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 12:14 PM
Hi @Joshuu ,
Can u try writing this whole condition in a script include n returning true or false based upon logged in User. Validate everything in 1 script include. In ur condition field of UI action just call the script include passing current as parameter
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 12:49 PM - edited 11-23-2023 12:53 PM
Hi @Danish Bhairag2,
Thanks for your response.
Could you please check below.
(new sn_major_inc_mgmt.MajorIncidentTriggerRules(current)).canProposeMIC() && checkGroupMIM(current).getgrpmim()
I am getting the below error on the incident form.
AbstractAjaxProcessor undefined, maybe missing global qualifier
Could you please help me on this.
Thanks & Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 07:09 PM
Hi @Joshuu ,
It's because the script include which u r using was set for client callable. The 1st two lines appear when u click on client callable.
Hence the error.
Can u create a new script but don't click on client callable then paste ur code n check.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 11:07 PM
Hi @Danish Bhairag2,
I have updated the script as below. the error is gone now but the condition is still not working.
var checkGroupMIM = Class.create();
checkGroupMIM.prototype = {
initialize: function() {},
getgrpmim: function() {
var answer = 'false';
var usr = gs.getUser;
if (usr.isMemberOf('IT Operations Center Support')) {
answer = 'true';
} else if (usr.isMemberOf('Service Desk')) {
answer = 'true';
} else if (usr.isMemberOf('Incident Management')) {
answer = 'true';
}
return answer;
},
type: 'checkGroupMIM'
};
Please correct me if my script is wrong.
Thank you.