Change of state for certain issue types when sprint is archived

Hi! Is it possible to somehow use isArchived property for Sprint (say, issue.sprints.added.first().isArchived) to automate change of state for certain issue types included in a particular sprint at the moment when this sprint is archived?
0
10 comments
Hello,
I'm Lena from YouTrack.
Unfortunately, workflow reacts only to the changes in the issues. We don't have such types of workflows which react to changes in the boards or sprint settings. As a possible workaround, you can create an on-schedule rule which will check if the issue is a part of the sprint and if this sprint is archived and then change its field value. 
Let me know if you have additional questions.
0

Hej, tried the following, however, cannot figure out why it's not working: 
- incorrect cron expression? what time is used to trigger that automation: datacenter time of some other? 
- incorrect search syntax?

Thank you in advance

 

const entities = require('@jetbrains/youtrack-scripting-api/entities');

exports.rule = entities.Issue.onSchedule({
  title: 'Check Ads Integration Issues in archived Sprint',
  search: 'Type: {Ads Integration} Ads State: - {Check Later} Fix versions: Archived',
  cron: "0 0 4 ? * * *",
  action: (ctx) => {
    ctx.issue.AdsStateState = ctx.AdsStateState.CheckLater;
  },
});
0

At first sight, both search query and cron are fine. Are there any errors in the workflow.log

 

0

Also tried Workflow builder 

The event log at least says:

workflow_user_9061200797803271141
18 Jul 2023 17:50
Mode: set
workflow_user_9061200797803271141
18 Jul 2023 17:50
Current value:,{"becomesRemoved": "false", "isNew": "false", "$$type": "State", "toString": function() {}, "toShortString": function() {}, "required": function() {}, "becomes": function() {}, "is": function() {}, "was": function() {}, "isChanged": function() {}, "oldValue": function() {}, "canBeReadBy": function() {}, "canBeWrittenBy": function() {}, "constructor": function() {}, "isResolved": "false", "backgroundColor": "#fff", "foregroundColor": "#444", "presentation": "Open", "isArchived": "false", "colorIndex": "0", "description": "null", "name": "Open", "ordinal": "1"}
0
Hello,

Could you please specify if you first tested the search expression in the search bar on the issues list page? Does it show the correct issues filtered?
0

yes, everything is fine with that

 

0

Yulia Svirskaya the event log shows that the workflow was triggered and that it found some issues to change. If the state of that issue didn't change, please check that there are no additional workflows that can change the state back.

0

Hi, there are no additional workflows. However, please note, that today this automation (JavaScript) suddenly started to work (nothing changed from Wednesday 19.07). Has anything changed from YT side? 

If not, I would suppose, that there might be a problem with CRON expression and, say, 0 54 16 ? * * * triggers rules not every day on 16:54, but every Monday, however, it seems very unlikely

0

It is difficult to say if anything has changed. The cron expression that you have should run every day. Does the workflow run every day now?

0

Please sign in to leave a comment.