Auto Problem Record Creation from Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2019 06:52 AM
Once the major incident is closed , I want to create Problem Record from there automatically.
How to achieve that ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2019 07:07 AM
Create After Business Rule on Incident Table
When : After
Update : True
Condition : State changes to completed
var newProblemID;
var gr = new GlideRecord("problem");
gr.initialize();
gr.short_description = current.short_description;
gr.description = current.description;
gr.category = current.category;
gr.subcategory = current.subcategory;
gr.assignment_group = current.assignment_group;
gr.business_service = current.business_service;
gr.cmdb_ci = current.cmdb_ci;
gr.comments = gs.getMessage("This is created after completing of incident - {0}",current.number);
newProblemID = gr.insert();
current.problem_id = newProblemID;
current.comments = gs.getMessage("New Problem - {0} is created for this incident",gr.number);
current.update();
gs.addInfoMessage(gs.getMessage("New Problem - {0} is created for Incident - {1} ",[gr.number,current.number]));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2019 03:30 AM
Hello Sai,
Your code looks fine. I just wanted to add few points here:
1.Use of current.setWorkflow(false); as you have used current.update() in after business rule.
2. Or we can gliderecord table and can update using gr.update();
3. It it not recommended to use current.update() in After Business Rule.
Thanks,
Abhishek
Abhishek Gardade