- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 02:34 AM
Hello,
Wa recentely started to use a Problem module. I have a question: how to copy the Impacted CI's field from the Problem form to an Affected CI's field of the Problem Task' form. I also want to have a condition, if Impacted CI's field changes in the Problem, so the value in the Affected CI's field in Problem Task changes too.
The fields 'Impacted CI' and 'Affected CI' have different types. So I wanted to know what is the best way to do it?
The Impacted CI's field on the Problem form:
The affected CI's field on the Problem Task's form:
Thank you in advance for your answers,
Elena
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 10:36 AM
Hi @Elena7 Sorry for the confusion, Can you Please revert back to the initial version of my Business Rule on "Problem task "table and on top of it Create a new Business rule on the "Problem" table as below:
(function executeRule(current, previous /*null when async*/ ) {
var PT = new GlideRecord('problem_task');
PT.addQuery('problem', current.sys_id);
PT.query();
while (PT.next()) {
PT.cmdb_ci = current.cmdb_ci;
PT.update();
}
})(current, previous);
Thanks & Regards,
Eswar Chappa
Mark my answer correct and Helpful if this helps you 😀
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 06:47 AM - edited 09-06-2023 06:48 AM
Hi @Elena7 Please You can achieve it use the below Business rule with the code given below:
(function executeRule(current, previous /*null when async*/) {
current.cmdb_ci= current.problem.cmdb_ci;
})(current, previous);
Thanks & Regards,
Eswar Chappa
Mark my answer correct and Helpful if this helps you 😀
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 07:11 AM
Hello @Eswar Chappa,
Thank you for your answer. It works perfectly when I create a new problem and then I create a new Problem Task. But it doesn't work when I update the Impacted CI's field in the Problem form. The Affected CI's field of the Problem Task' form doesn't change. Do you know how to do it?
Thank you in advance,
Elena
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 07:18 AM - edited 09-06-2023 07:22 AM
Hi @Elena7 in the business rule condition take an Or condition and in the field options type show related fields and the open Problem related fields and select the Impacted CI field and select the filter as changes and save the business rules and try for sure it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 07:38 AM
I put Impacted CI in the business rule condition, because I didn't find Configuration item, but it doesn't work.
The condition I added:
The field I change:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 07:46 AM
Hi @Elena7 can please change the condition problem is not empty to "task impact item is empty"