Knowledge Manager field autopopulate in Knowledge base form

Atchutaram
Tera Contributor

Hi Team,

                 I have been working on Kb's and i want to write  a business rule like, we do have Approvers group field on Knowledge base form and Manager's field. I want to auto populate the names of the user's who are part of approvers group in Manager field on Knowledge base form.

we have around four bases. how can we do it.

And when ever a user is added or removed from group it should reflect in KB form.

 

How can i do this?

 

 

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Atchutaram 

 

I did not find approver field on base level. Is it custom?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

For example, we do have one group approver for every knowledge base based on the flow, i want to get the group members in that manager field(which is of list type) on knowledge base form.

 

I want to get the group members in that manager field.

Basheer
Mega Sage

Hi @Atchutaram 

Here you need to create the manager field type as list.

 

You should write a business rule on sys_user_grmember (Group Members) table with insert, update and delete
In the code you need to write as below 

var user = current.user;
var group = current.group;
var manager = " ";

var kbRecord = new GlideRecord("Your kb table name");
kbRecord.addQuery("Approvers group field name", group);
kbRecord.query();
While(kbRecord.next()){
if(current.action == "insert" || current.action == "update"){
kbRecord.manager = kbRecord.manager+","+ KbRecord.user;
}
else{
kbRecord.manager = kbRecord.manager.(Do your remove operation accrodingly)
}
kbRecord.update();
}

 

Please mark correct, if this has solved your problem.

Please mark helpful, if this has helped you in any way.

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

Hi Basheer,

                      Will this work when i want to autopopulate the group members names in that manager filed? as we do have different knowledge bases for every knowledge base will this work? 

in the second line of code where you mentioned "approvers group field name" should i give the sys_id of the group i wanted to autopopulate?