Remove old jobs from Kanban board

Hi all,

Each of our teams has its own agile board - some are Agile boards with sprints and others are Kanban boards.

 

The teams that are using Kanban boards are running into issues where their 'Done' column is clogging up with history. We need to keep the done column for quick reference and for conducting retros. 

 

I want to create a workflow rule that checks:

* The issue is on one of a list of board names (note that the will not be sprints)

* The issue has been resolved more than X days ago (and is still resolved)

 

If the above conditions are met, remove it from the board(s). 

 

Has anyone been able to achieve this?

4 comments
Comment actions Permalink
Official comment

Hi!

I'm Sergey from the Youtrack team.

There's no ready-to-use code for that, though it should definitely be possible. Let me share some tips. 

>The issue is on one of a list of board names (note that the will not be sprints)

The issue entity has a board property that returns a set of boards this issue is in, e.g., ctx.issue.boards

>The issue has been resolved more than X days ago (and is still resolved)

Same as above, the issue entity has a resolved property that returns date and time. Moreover, there's a property that checks if the issue is resolved right now. 

>If the above conditions are met, remove it from the board(s)

As I mentioned, the boards are returned as a set, so you can use the set's delete() method to remove the boards from the issue. 

Hope this information helps. 

If any questions appear, please let me know. 

Comment actions Permalink

Hi Sergey Merzlov

I have managed to get the boards assigned to an issue using ctx.issue.boards, which is returning

[{"$$type": " Agile", "name": "ABCD"},
{"$$type": " Agile", "name": "EFGH"}]

I am having trouble checking if the issue is on board ABCD, and also removing it from ABCD. How would this look?

I have tried ctx.issue.boards.has('ABCD') but that is not working, not sure of what the syntax should be. 

 

Basically I need to check if it is on ABCD so that I can also check if it has been completed within the last X days for Board ABCD (X changes depending on the board), and then remove it from board ABCD. 

0
Comment actions Permalink

Hi, Sergey Merzlov

Is there an issue I can subscribe to follow this feature?

My thoughts is that this feature must be ready-to-use - for closed/done/ready column to have a field to set number of days to show

0
Comment actions Permalink

Thanks for your reply. 

>I have tried ctx.issue.boards.has('ABCD') but that is not working, not sure of what the syntax should be. 

You can use the find method in the board's set: https://www.jetbrains.com/help/youtrack/standalone/v1-Set.html#find

>My thoughts is that this feature must be ready-to-use - for closed/done/ready column to have a field to set number of days to show

No, we don't have such a feature request, and it seems to be rather a specific one. That's why we have a workflow API that can help you relatively easily introduce such functionalities in your installation, thus meeting your team's needs and requirements. 

If any questions appear, feel free to ask. 

0

Please sign in to leave a comment.