- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 08:26 AM - edited 05-02-2023 08:27 AM
Hi
this is my script
var gr = new GlideRecord('sc_task');
gr.addQuery('number', 'NUMBER');
gr.query();
if (gr.next()) {
var today = new GlideDate();
today.setDisplayValue('yyyy-MM-dd');
if (gr.variables.termination_date == today.getValue()) {
gr.setValue('state', '2');
gr.update();
}
}
I am not sure why this is not working?
and one more question which type of BR suits the best for my condition?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 09:53 AM
Working fine amit,
just the format missed, I have corrected it and working now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 06:38 PM
When I using the schedule job with date diff calculation.
If current date is greater than current date I mean diff <0 then need to change the sctask state to in progress
But state is not changing