closing of problem record only when all the problem tasks are closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2021 06:20 AM
Hi everyone,
In problem record , problem record will be closed only when all the ptasks are closed complete. before the record is closed then a message should be display please close the ptask .
if we cancel the problem record then all the problem task will be changed to closed complete auttomatically.
- Labels:
-
Problem Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2021 12:00 AM
HI ankur ,
there is no existing ui action here ,only thing is when problem record get cancel then their ptasks get marked as closed automatically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2021 12:06 AM
Hi,
then create new UI action Cancel on problem table
Make that UI Action as server side and add the script I shared.
Follow the steps and share us the update
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-02-2021 05:28 AM
Any update on this?
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-2021 12:46 AM
yes its worked but they dont want the ui action they are asking script like if the state value is cancel then problem task can also be automatically closecomplete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2021 10:05 PM
Glad to know that my script worked.
then you would require after update BR on problem table
Condition: State [Changes to] Cancel
Script:
try{
// your code
var gr = new GlideRecord("problem_task");
gr.addQuery("problem", current.getUniqueValue());
gr.query();
while(gr.next()) {
gr.state = 157; // closed
gr.update();
}
}
catch(ex){
gs.info(ex);
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader