- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 08:46 AM
Hi Team,
Good Day!!
I need a background script for changing a field (Task type) value (from Test to Post-Work).
We dont have field value in numbers as like in Incident.Attached the screenshots.
Please check . the script is not working as it takes any value given other than Test,Work,Pre-Work,Post-Works too.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2019 10:58 PM
Hello Anand,
We are using IN operator if we want to find numbers from comma separated values provided in query.
For example.
ctask.addQuery('number','CTASK0753800,CTASK0753801,CTASK0753802');
As you need to find it for single ctask, then either you can use addQuery without IN,
var ctask = new GlideRecord('change_task');
ctask.addQuery('number','CTASK0753800');
ctask._query();
if(ctask._next()) {
ctask.u_type="Post-Work";
ctask.setWorkflow(false);
ctask.update();
}
Please mark as Correct Answer and Helpful, if applicable.
Thank You!
Abhishek Gardade
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2019 10:58 PM
Hello Anand,
We are using IN operator if we want to find numbers from comma separated values provided in query.
For example.
ctask.addQuery('number','CTASK0753800,CTASK0753801,CTASK0753802');
As you need to find it for single ctask, then either you can use addQuery without IN,
var ctask = new GlideRecord('change_task');
ctask.addQuery('number','CTASK0753800');
ctask._query();
if(ctask._next()) {
ctask.u_type="Post-Work";
ctask.setWorkflow(false);
ctask.update();
}
Please mark as Correct Answer and Helpful, if applicable.
Thank You!
Abhishek Gardade
Abhishek Gardade