Hide 'Resolve' button and 'Resolved' state when there are an active Incident Tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2019 07:59 AM
Hi community,
Any help would be appreciated here!
I require to hide the 'Resolve' button and 'Resolved' state of an Incident if there are active Incident Tasks associated to a parent Incident record (if the logged on user is not admin). I have come across a few posts in the community (e.g. the following link) but none of these seem to be working for me.
(I thought this may provide some guidance too --> https://community.servicenow.com/community?id=community_question&sys_id=7bc00f65db98dbc01dcaf3231f96...)
If anyone can post step by step guide in what needs to be done to achieve this/any help would be greatly appreciated!
Thanks,
Bas
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2019 08:09 AM
Hi,
you can handle this via script include function
script include:
var ConditionUtils = Class.create();
ConditionUtils.prototype = {
initialize: function() {
},
determineVisibility: function(){
if(gs.hasRole('admin'))
return true;
else
{
var gr = new GlideRecord("incident_task");
gr.addQuery("parent", current.sys_id);
gr.addEncodedQuery('active=true');
gr.query();
if (gr.next()) {
return false;
}
return true;
}
},
type: 'ConditionUtils'
};
call the function inside the condition field of both the UI actions:
new ConditionUtils().determineVisibility()
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 04:59 AM
Thanks for you response Ankur.
I have found an alternative solution for the visibility of the UI button which meets our requirements, however thanks nonetheless for your suggestion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 05:39 AM
Hi Basim,
Can you mark my answer as correct and helpful; it it helped.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2019 09:08 PM
Hi Basim,
Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader