Why the List Action was not working in my list in workspace?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 12:40 AM - edited ‎02-27-2025 12:40 AM
Hi All,
Actually I have created one List UI action "Allocate Task", in the Catalog task table , so here i need two things
1) This Ui action was need to display only on list "Assigned to your team" not on the "Assigned to You " list
2)when we click on this Ui action ,the earliast catalog task (only one)was need to assigned to me , but it assigned all the catalog tasks to me, i put set limit as well but not working
Please help me to complete this
Thanks
Ramu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2025 02:00 AM
print the count outside
try this
function assignToMe() {
var count = '0';
var rec = new GlideRecord('sc_task');
rec.addNullQuery('assigned_to');
rec.addQuery('state', 'IN', '1,2');
rec.setLimit(2);
rec.query();
gs.addInfoMessage(gs.getMessage('Number of Records updated' + rec.getRowCount());
if (rec.hasNext()) {
while (rec.next()) {
rec.assigned_to = gs.getUserID();
rec.setWorkflow(false);
rec.update();
}
} else {
gs.addInfoMessage(gs.getMessage('No new tickets found!' + rec.sys_id));
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2025 02:06 AM - edited ‎03-03-2025 02:08 AM
Thanks for the code.
Tried this, its printing like this, but still updating multiple records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2025 02:08 AM
not very sure then
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader