Auto close when parent incident is closed automaticcally child incident to be closed and also same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 05:49 AM
Hi,
When parent incident is closed then automatically child incident will be closed and When child incident closed then automatically parent incident will be closed (Both sides).
How to achieve this and I tried this code but not working for me so can you please give me a code.
Thanks in Advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 06:40 AM - edited 08-29-2023 06:40 AM
As per your code:
When parent incident is closed then automatically child incident will be closed - Its worked when applied your code.
and When child incident closed then automatically parent incident will be closed - Not working.
Can you please provide me any alternative solution for 2nd one
Thanks
Maniseshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 06:52 AM
Hi @mania ,
I tested it again, It is working fine. Check your BR conditions and logs, if there is any error.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 09:38 AM - edited 08-29-2023 09:39 AM
When we choosing any of the record in configuration item field in outage form in same incident form it will reflected to same record in Configuration item field, Affected CIs and Impacted Services/CIs related list in major incident from.
Can you please how to do this in business rule.
Thanks
Maniseshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 08:34 AM
Hi @mania ,
Try the following BR.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var inc = current.getValue('task_number');
var incGr = new GlideRecord('task');
if (incGr.get(inc)) {
if (incGr.getRecordClassName() === "incident") {
var ci = incGr.getDisplayValue("cmdb_ci") + '';
if (gs.nil(ci)) {
incGr.cmdb_ci = current.cmdb_ci;
incGr.update();
} else {
//Affected CI
var tciGr = new GlideRecord("task_ci");
tciGr.addQuery("task", inc);
tciGr.addQuery("ci_item", current.cmdb_ci);
tciGr.query();
if (!tciGr.next()) {
tciGr.initialize();
tciGr.setValue("ci_item", current.cmdb_ci);
tciGr.setValue("task", inc);
tciGr.insert();
}
}
//Impacted CI
var iciGr = new GlideRecord("task_cmdb_ci_service");
tciGr.addQuery("task", inc);
iciGr.addQuery("cmdb_ci_service", current.cmdb_ci);
iciGr.query();
if (!iciGr.next()) {
iciGr.initialize();
iciGr.setValue("cmdb_ci_service", current.cmdb_ci);
iciGr.setValue("task", inc);
iciGr.insert();
}
}
}
})(current, previous);
You can modify the code to suit further requirements.
Please mark my answer helpful and accept as solution, if it helped you
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 01:39 AM - edited 09-04-2023 01:40 AM
For the "Configuration Item" field, it is populated with OOB items. Can you hide the OOB items from the "Configuration Item" field? - How to hide all the Configuration item (cmdb_ci) records in Configuration item in incident and Request form.
I filter out all created by users on cmdb_ci form then I pasted that query in reference qualifier on request form like shown in image below its worked for request configuration item field but I applied same query on incident configuration item field didn't worked in incident form.
Can you please help on this.
Thanks!
Maniseshu