current.task is not updating as intended
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 12:25 PM
current.state = -5;
current.type = "implementation";
current.short_description = "example 1";
current.description = example1a;
//begin AG
var findAG = new GlideRecord('sys_user_group');
findAG.addQuery('name', 'STARTSWITH', 'exampleAgroup');
findAG.orderBy('name');
findAG.query();
if (findAG.next()) {
current.assignment_group = findAG.sys_id;
}
//end AG
current.insert();
current.update();
current.type = "testing";
current.state = -5;
current.short_description = "example2";
current.description = "example2b";
//begin AG
var findAG = new GlideRecord('sys_user_group');
findAG.addQuery('name', 'STARTSWITH', 'exampleBgroup');
findAG.orderBy('name');
findAG.query();
if (findAG.next()) {
current.assignment_group = findAG.sys_id;
}
//end AG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 01:32 PM - edited 06-04-2025 01:36 PM
Hi,
You are calling current object by utilizing the current.*** . And there will be only one "current" object(I mean you can only update one TASK). So what ever script you are using after current.update() will not work.
If there is another current.update() it will override the above changes but not recommended in a single activity.
I am assuming you might be using workflow to execute the code.
There should be similar separate activity(Catalog Task) in the workflow for other TASK related activities.
Or If you want 2 TASKs, you have to create a separate "Catalog Task" activity in your flow.
Mark as correct and helpful if it solved your query.
Regards,
Harish