How to get tasks state in Service Portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 07:49 AM
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");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 08:42 AM - edited 06-05-2024 08:44 AM
Hi @MysUser Try to make Catalog Client Scripts UI Type is All.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0722501
Regards,
Sid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 01:13 PM
Thank you, but its already set as "All".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 02:33 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 03:58 AM
All seems to be right. This is weird. Maybe these parameter is not available from ServicePortal?