The CreatorCon Call for Content is officially open! Get started here.

What this statement mean "new KBWorkflow().startWorkflow(current, "workflow");" in script?

Gamarawaji
Giga Contributor

Hi ,

can someone explain why this statement can be used in script 

new KBWorkflow().startWorkflow(current, "workflow");

what exactly this will give the result?

 

 

 

2 REPLIES 2

eumak
Tera Guru

Hello @Gamarawaji ,

The above statement is to call a script include in workflow or BR or reference qualifier.

For the statment [new KBWorkflow().startWorkflow(current, "workflow");]

KBWorkflow - script include name
startWorkflow - Function in the SI
current, "workflow"  - are the parameters.

The full statement will return the results to Restart Knowledge workflow using script in servicenow

Mark it helpful or correct, If Applicable

Cheers..!
Happy Learning:)
Tushar

 

 
Mark it as helpful or correct, If Applicable


Cheers..!

Happy Learning:)

Tushar

Gamarawaji
Giga Contributor

if (current.sys_updated_by == "AUTOKMIMPORT") {
if (current.kb_knowledge_base.kb_version == "3") {
new KBWorkflow().startWorkflow(current, "workflow");
current.update();
}
}
}

 

this is the code