- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 12:38 AM
Hi Team,
We have created a reference field (BIA Knowledge Article) in business application cmdb form.It will shows the KB article display number in the field.
So, If KB article expire after 1 year - Then users are updating the KB article through portal.
But Here Its not taking the new updated version number. Its still showing the old version number
Its showing the updated display number in the search box - But its not taking the new value in the field. Still we are updating this process manually - Kindly please assist.
We have return After BR - But its not working as expected.
Thanks,
Sai
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 05:02 AM
Hi @babbi / @thaduri sai
Try the following code and check the system log, if you didn't find any of the log statement, it means the BR didn't ran, if it is running observer which log statement is not logged.
(function executeRule(current, previous){
var BIA = new GlideRecord("cmdb_ci_business_app");
BIA.addQuery('sys_id', current.cmdb_ci);
BIA.query();
gs.info('Before BIA IF Condition');
if(BIA.next()){
gs.info('Found BIA');
BIA.setValue('u_bia_knowledge_article', current.getUniqueValue());
vat update_res = BIA.update();
if(update_res){
gs.info('Updated BIA KB Successfully');
} else{
gs.info('Updated BIA KB Failed');
}
}
})
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 11:34 PM - edited 09-17-2023 11:35 PM
Hi @thaduri sai ,
In your BR script the if condition is written as If (Capital I) instead of if in line number 11. And I feel like the entire line number 11 is not required. Please comment that line and save the BR then try updating the article and check whether the reference updated successfully or not.
Please mark my answer helpful/accept my solution as answer if it helped you to fix this issue. ✔️👍
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 04:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 05:02 AM
Hi @babbi / @thaduri sai
Try the following code and check the system log, if you didn't find any of the log statement, it means the BR didn't ran, if it is running observer which log statement is not logged.
(function executeRule(current, previous){
var BIA = new GlideRecord("cmdb_ci_business_app");
BIA.addQuery('sys_id', current.cmdb_ci);
BIA.query();
gs.info('Before BIA IF Condition');
if(BIA.next()){
gs.info('Found BIA');
BIA.setValue('u_bia_knowledge_article', current.getUniqueValue());
vat update_res = BIA.update();
if(update_res){
gs.info('Updated BIA KB Successfully');
} else{
gs.info('Updated BIA KB Failed');
}
}
})
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 06:42 AM
Thanks @AnveshKumar M - Its working now.