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

Sid_Takali
Kilo Patron
Kilo Patron

Hi @MysUser Try to make Catalog Client Scripts UI Type is All.

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

SiddharamTakali_0-1717602343706.png

 

Regards,

Sid

 

Thank you, but its already set as "All".

Hi @MysUser Are you applying this Catalog Client Script on Record Producer?

Check you Catalog Client Scrip Configuration, I don't see any mistake in code. 

All seems to be right. This is weird. Maybe these parameter is not available from ServicePortal?