Skip to content

Commit 57000cc

Browse files
authored
Condition script to trigger the scheduled job on quarterly basis (#1440)
* Create Condition script to trigger the scheduled job on Quarterly basis.js Created "Create Condition script to trigger the scheduled job on Quarterly basis.js" file with the script which can be used in the condition script to trigger the scheduled job only when month is March, June, September, December * Create README.md Created README.md file for "code-snippets/Scheduled Jobs/Condition script to trigger the scheduled job on Quarterly basis/Condition script to trigger the scheduled job on Quarterly basis.js"
1 parent 588aefc commit 57000cc

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var d = new Date();// getting today's date
2+
var month = d.getMonth();// getting the month
3+
var a = month.toString();
4+
if(a== '2'|| a=='5' || a=='8' || a=='11'){//condition will be true only when month is March, June, September, December
5+
answer = true;
6+
}
7+
else{
8+
answer = false;
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The script in code-snippets/Scheduled Jobs/Condition script to trigger the scheduled job on Quarterly basis/Condition script to trigger the scheduled job on Quarterly basis.js
2+
can be used in the condition script of scheduled job so that the scheudled job will trigger only quarterly.
3+
4+
The script will make the answer true only on March, June, September, December months. All other months the script will make answer false.
5+
6+
Use Case:
7+
There will be requirement to send audit tasks and approvals on every Quarter Day 1 (March 1, June1, September1, December1).
8+
In this case the scheeduled job can be scheduled for every month day 1. Then in the condition script, the script in "Condition script to trigger the scheduled job on Quarterly basis.js" can be used.

0 commit comments

Comments
 (0)