How do I create a Business Rule that will automatically create a Knowledge article?

barbclark
Mega Expert

We have an existing business rule that will automatically create a Knowledge NEWS topic article based on Priority = High and Service Board being checked.       I am trying to create a new business rule or possibly modify the existing one that will merely change the topic.         My business rule is not working.     I need assistance.     This is my first business rule to try.           I do not see where I can attach my business rule here in this new HI format.    

1 ACCEPTED SOLUTION

edwajs
ServiceNow Employee
ServiceNow Employee

Hi Barbara,



Your business rule is not structured to call your code.



When a business rule is created in Fuji releases and newer, the system automatically brackets all of the code inside a function.



function onBefore(current, previous) {


    //This function will be automatically called when this rule is processed.


   


}



Per your attached screenshot, you have this function in your business rule as expected.   But then you appended all your code and your new functions after this one, and outside the structure.



Try the following:



function onBefore(current, previous) {


    //This function will be automatically called when this rule is processed.


    var sub = gs.getProperty('glide.knowman.submission.workflow');


   


    if (sub == 'true')


      submitCandidate();


    else


      submitDirect();


}



function submitDirect() {


    // your function


}



function submitCandidate() {


    // your function


}


View solution in original post

11 REPLIES 11

shahid.shah  



dan.bruhn & madhurigudiseva have already connected with barbclark and we are going to be walking through the email notifications clarification.



Will keep the team posted.



thanks.


Barb,



Please let us know if you were able to configure your notifications.


thanks.