How to reduce the issues amount witout delete them to save space or is there any other tips on reducing data in YouTrack

Hey 
We trying to reduce the issues amount without deleting them, something like archiving function to issue-level.

Currently from what i see in the documentation, it can be done only on the project level, and sprint level  which but  it is too general.
Any other tips on saving space is much appreciated.
Thanks 

0
12 comments
Official comment

Hi! 

I'm Sergey from the Youtrack team. 

Thank you for the post. 

Archiving projects won't help in terms of reducing taken space, as the data remains to be stored in the database. 

To get a really noticeable effect in decreasing the database size, we recommend removing big attachments. For example, you can search for the issues with the attachments with the following query: has:attachments. Then you can delete the attachments from the issues. Starting from Youtrack 2020.4, which is expected to be released at the end of October 2020, you will also be able to search by attachment size:  sort by: {Attachment size} 

You can also do it via our Javascript workflow API or Rest API

Generally, even if you decide to remove the issues, it's unlikely to bring any substantial results in terms of space reduction, as on average, 5000 issues just take up just 1GB of disk space. 

If any questions appear, feel free to ask. 

@Sergey Merzlov 
Thanks for your answer i have taken the API route to delete attachments.
The problem is that each member of the organization that is mentioned in the issue getting an email when i delete and add a comment ( comment with info on deleting ) . so they can get Dozens of emails as I'm looping throw Thousands of issues 
is there any way to disable sending email when i do the delete + comment API call? 
Thanks

0

Thanks for your reply. 

I'm afraid it is not possible to disable notifications when deleting the attachments via REST API. Yet, if that's a priority, then I suggest opting in for a workflow approach. 

You can create an on-schedule rule that will be executed once and remove the attachments. For example, ctx.issue.attachments contains a set of the issue's attachments. You can iterate through this set and remove the attachments using the delete() method

For instance, the following code will delete all issue's attachments:

ctx.issue.attachments.forEach(function(file) {
      file.delete();
    });

To disable notifications, an on-schedule rule has a property muteUpdateNotifications For more information, please refer to https://www.jetbrains.com/help/youtrack/incloud/on-schedule-rules.html#sample-on-schedule-rule.

0

@Sergey Merzlov
Thanks , well this is an option 

Good idea is to add this flag to the rest API 

muteUpdateNotifications 

Can i add a comment to each issue im deleting from with this on schedule rule?

0

@Sergey Merzlov

another question that is related to the API 
i suspect you have a bug in the get issue by date range 
i have this API call :
https://track.personetics.com/youtrack/api/issues?fields=id,created,summary,date,idReadable,customFields(id,projectCustomField(field(name)))&$skip=0&$top=1000&query=has: attachments created: 2016-01-01 .. 2017-12-30

where each time i increase the $skip=0&$top=1000

fields=id,created,summary,date,idReadable,customFields(id,projectCustomField(field(name)))&$skip=0&$top=1000&query=has: attachments created: 2016-01-01 .. 2017-12-30

 

fields=id,created,summary,date,idReadable,customFields(id,projectCustomField(field(name)))&$skip=1000&$top=2000&query=has: attachments created: 2016-01-01 .. 2017-12-30

 

fields=id,created,summary,date,idReadable,customFields(id,projectCustomField(field(name)))&$skip=2000&$top=3000&query=has: attachments created: 2016-01-01 .. 2017-12-30

 

until there is no more issues , the problem is that I'm getting duplicate issues in the results from list of 14000 issues almost 3000 are duplicates 

Any idea why ? 

 

 

0

Thanks for your reply.

>Can i add a comment to each issue im deleting from with this on schedule rule?

Yes, here's the method in the issue entity in the workflow API: https://www.jetbrains.com/help/youtrack/incloud/v1-Issue.html#addComment

>Good idea is to add this flag to the rest API 

It's already supported in the resource that allows applying commands: https://www.jetbrains.com/help/youtrack/standalone/resource-api-commands.html It covers most of the cases. In other ones, a user has access to the on-schedule workflow. So adding this parameter to all API resources seems excessive, and we currently don't have plans to do it. 

>another question that is related to the API i suspect you have a bug in the get issue by date range 

There doesn't seem to be any bugs here. I've left a detailed reply in your other thread: https://youtrack-support.jetbrains.com/hc/en-us/community/posts/360009876840-Pagination-API-with-query-retunes-duplicat-issues-?page=1#community_comment_360002336020

If any questions appear, let me know. 

0

Sergey Merzlov 
Great so i can if i have the issue ID  i can use it in the issues Field  of the API call 
And set silent=true right ? 
How such API call should look like ?

0

Thanks for your reply. 

The silent part is for a command that you can apply via API. How this call should look, what fields it accepts, and so on can be found in the documentation I linked: https://www.jetbrains.com/help/youtrack/standalone/resource-api-commands.html#CommandList-supported-fields

Note that this doesn't work for your case of removing the attachments as it can't be done via a command. It was a general example in a reply to your suggestion. 

0

@Sergey Merzlov
i think that the notifications are sent when i add the comment to the issue not the delete operation ( not sure ) to both ...? 

0

Sorry, I'm afraid I'm not sure what you mean, so let me explain in the general. To do an action via an API or workflow without sending a notification, you have two options in general: 

* write an on-schedule rule and specify the muteUpdateNotifications property. After that, any changes (e.g., removing attachments, adding comments, whatever) made through this rule will be silent 

* use the command endpoint in API, which has a silent field. However, using a command, you can't remove the attachments

If that's not helpful, please elaborate on your question. Thanks. 

0

@Sergey Merzlov
ok I will use another api to remove it , but to add a comment i can use this, right?

0

The comment can be added via an API, workflow, and command — whatever you prefer. 

0

Please sign in to leave a comment.