Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get tasks state in Service Portal?

MysUser
Tera Contributor

Hi, I'd like to get the current task state.

Below code (Catalog Client Script) works on Desktop/backend/CMS, but not on Service Portal.

Do you have any ideas? 🙂

 

function onLoad() {
   var state = g_form.getValue("state");
   if  (state == '2') {
   		 alert("State is Work in Progress");
   }
   
}

 

5 REPLIES 5

Hi @MysUser alert() will work in Service Portal. 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0722501 

 

Regards,

Sid