Cannot get on-schedule Workflow to run Follow
Hi there,
I am on InCloud - and whatever I try, I cannot get this on-schedule Workflow to run. Any ideas?
var entities = require('@jetbrains/youtrack-scripting-api/entities');
exports.rule = entities.Issue.onSchedule({
title: 'Update-all-epicidforexports',
search: 'type:{User Story},Bug project:example1,example2 sprints: sprint34',
cron: '0 10 13 * * ?',
muteUpdateNotifications: true,
guard: function(ctx) {
return true;
},
action: function(ctx) {
var parent = ctx.issue.links['subtask of'].first();
console.log("start");
if (parent && parent.isReported) {
if (ctx.issue.EpicIDForExports != parent.id + ' ' + parent.summary) {
ctx.issue.EpicIDForExports = parent.id + ' ' + parent.summary;
console.log(ctx.issue.project.name + ' : Update custom field with parent issue id for ' + ctx.issue.id + ' done with ' + parent.id + ' ' + parent.summary);
}
} else {
if (ctx.issue.EpicIDForExports) {
ctx.issue.EpicIDForExports = null;
console.log(ctx.issue.project.name + ' : Clear custom field on ' + ctx.issue.id);
}
}
},
requirements: {
EpicIDForExports: {
name: 'EpicIDForExports',
type: entities.Field.stringType
}
}
});
The only thing it does, is copy epic link information to a custom field (to have the epic link in the exports). The query returns tickets when I search it in youtrack. There are no errors shown on the scheduled execution time. Code inspection shows no errors.
In this case I was expecting it to run today at 13:10 o clock.
Can anybody help me out?
Kind regards
Please sign in to leave a comment.
Hello,
I'm partially copying my answer from then ticket: the current expression transforms to at 10:00 am on the 15th of every month. If you want to run it every day at 13:10 the expression should be the following 10 13 * * *