How to track reopened issues

Hallo.

I need to find issues in my project, not passing verification successfully. So, exactly issues moved from to Verify state to Open. I need list of issues, not a statistical report, because i need to track these failures and find weak spots in process.|
 

How can i do that please? 







 

0
1 comment
Official comment

Hi there,

I'm Sergey from the YouTrack Team. Thanks for reaching out!

You can track state changes and mark issues accordingly. For example, you can add a tag or update another field to indicate that an issue was moved from Verified to Open. To automate this process, you can use a workflow, which is YouTrack's automation tool. Essentially, you create a script that handles issue-related tasks automatically.

Here's a simple proof-of-concept workflow that adds a tag when the state changes. You can then use this tag to search for these issues, include them in reports, and more:

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

exports.rule = entities.Issue.onChange({
  title: 'Tag issues that fail verification (Verify -> Open)',
  guard: (ctx) => {
    const issue = ctx.issue;
    console.log(issue.fields.oldValue(ctx.State));
    return issue.isChanged(ctx.State) &&
             issue.fields.oldValue(ctx.State).name === ctx.State.Verify.name &&
             issue.fields.State.name === ctx.State.Open.name;
  },
  action: (ctx) => {
    console.log('action');
    ctx.issue.applyCommand('add tag Failed-Verification', ctx.admin);
  },
  requirements: {
    State: {
      type: entities.State.fieldType,
      name: 'State',
      Verify: {
        name: 'Verify',
      },
      Open: {
        name: 'Open',
      },
    },
    admin: {
      type: entities.User,
      login: 'admin',
    },
  },
});

This is just an example that you can use as a foundation to create your own rule matching your specific requirements.

Let me know if you have any questions!

Please sign in to leave a comment.